??xml version="1.0" encoding="utf-8" standalone="yes"?>国产亚洲精品资源在线26u,亚洲人成网www,曰韩亚洲av人人夜夜澡人人爽http://www.tkk7.com/happyenjoylife/zh-cnMon, 12 May 2025 16:26:18 GMTMon, 12 May 2025 16:26:18 GMT60mysql innodb存储与烦引的ȝhttp://www.tkk7.com/happyenjoylife/archive/2011/12/17/366639.htmlhappyenjoylifehappyenjoylifeSat, 17 Dec 2011 08:36:00 GMThttp://www.tkk7.com/happyenjoylife/archive/2011/12/17/366639.htmlhttp://www.tkk7.com/happyenjoylife/comments/366639.htmlhttp://www.tkk7.com/happyenjoylife/archive/2011/12/17/366639.html#Feedback2http://www.tkk7.com/happyenjoylife/comments/commentRss/366639.htmlhttp://www.tkk7.com/happyenjoylife/services/trackbacks/366639.htmlInnodb存储

表空间是逻辑存放所有数据的地方Q默认情况下会共享一个表I间——ibdata1Q但如果?/span>innodb_file_per_table=ON后每张表可以单独攑ֈ一个表I间内,但还是有很多数据保存在共享的?/span>ibdata1中,?/span>undo信息{?/span>

 

表空间由各种D?/span>(segment)l成Q常见的D|数据Dc烦引段{?/span>Innodb是烦引组l的Q数据段是clustered index的叶l点。需要注意的是,不是每个对象都有Dc?/span>

 

?/span>(extend)是由64个连l的늻成,每个(pageQ固定ؓ16KBQ所以每个区d?/span>1M。页?/span>innodb最的盘理单位?/span>

 

Innodb是按行进行存攄Q每个区最可以保?/span>2条记录,否则成铑ּl构了。每行数据除了自定义列以外,q会增加事务id和回滚指针列。如果没有定?/span>primary key也没?/span>not null?/span>unique,则会增加6字节?/span>RowId列作Z键?br />        
            囄来自Q?a >http://www.cnblogs.com/chjw8016/archive/2011/03/08/1976891.html

Innodb表的限制

        一个表不能包含过1000列?/span>

  内部最大键长度?/span>3500字节Q但MySQL自己限制q个?/span>1024字节?/span>

  除了VARCHAR, BLOB?/span>TEXT列,最大行长度E微于数据库页的一半。即Q最大行长度大约8000字节?/span>LONGBLOB?/span>LONGTEXT列必d?/span>4GB, ȝ行长度,包?/span>BLOB?/span>TEXT列,必须于4GB?/span>InnoDB在行中存?/span>VARCHARQ?/span>BLOB?/span>TEXT列的?/span>768字节Q余下的存储的分散的中?/span>

虽然InnoDB内部地支持行寸大于65535Q你不能定义一个包?/span>VARCHAR列的Q合q尺寸大?/span>65535的行?/span>

·                mysql> CREATE TABLE t (a VARCHAR(8000), b VARCHAR(10000),

·                    -> c VARCHAR(10000), d VARCHAR(10000), e VARCHAR(10000),

·                    -> f VARCHAR(10000), g VARCHAR(10000));

·                ERROR 1118 (42000): Row size too large. The maximum row size for the

·                used table type, not counting BLOBs, is 65535. You have to change some

·                columns to TEXT or BLOBs

 在一些更老的操作pȝ上,数据文g必须于2GB?/span>

 InnoDB日志文g的合q尺寸必d?/span>4GB?/span>

最的表空间尺寸是10MB。最大的表空间尺寸是4,000,000,000个数据库(64TBQ。这也是一个表的最大尺寸?/span>

 InnoDB表不支持FULLTEXT索引

 

Innodb索引

默认情况?/span>Memory使用存储hash索引Q但也支?/span>b+tree索引?/span>Hash索引只用?/span>=或?/span><=>的等式比较,不能用来加?/span>order by操作Q只能通过关键字来搜烦一行?/span>innodb只支?/span>b+树烦引,q一步分?/span>clustered index 与 secondary index。在一ơ查询中Q只能用一个烦引?/span>

        

Innodb是烦引组l表Q?/span>clustered index的叶l点保存着整行的数据。如果,定义?/span>primary keyQ则clustered indexprimary key的烦引;如果没有定义primary key mysql会选中W一个仅?/span>not null列的unique索引作ؓ主键Qƈ把此索引当作clustered index使用Q如果没扑ֈq样的列Q?/span>innodb会创Z?/span>6字节?/span>RowId作ؓ主键。所以每张表有且只有一?/span>clustered index?/span>

 

         Secondary index的叶l点不包括行的全部数据,包含键g外还包括一?/span>bookmarkQ可以告?/span>innodbC么地方可以找到相对应的完整行数据Q还保存了主键的健倹{?/span>Secondary index包含主键Q但不包含完整的行数据,所?/span>innodbL会先?/span>secondary index的叶节点判断是否能得到所需的数据。如,

         Create table t(a int, b varchar(20), primary key(a), key(b));

Explain select * from t;

         会发?/span>mysql选择了烦?/span>bQ而不?/span>a.

复合索引

         复合索引是在多列Q?/span>>=2Q上建立的烦引,又叫多列索引或联合烦引?/span>Innodb中的复合索引也是b+ treel构。烦引的数据包含多列(col1, col2, col3…)Q在索引中依ơ按?/span>col1, col2, col3排序。如(1, 2), (1, 3),(2,0)…

 

         使用复合索引要充分利用最左前~原则Q顾名思义Q就是最左优先。如创徏索引ind_col1_col2(col1, col2)Q那么在查询where col1 = xxx and col2 = xx或?/span>where col1 = xxx都可以走ind_col1_col2索引?/span>

在创建多列烦引时Q要Ҏ业务需求,where子句中用最频繁且过滤效果好的的一列放在最左边?/span>

索引操作

         可以通过DML语句操作innodb索引。因?/span>innodb是烦引组l的表,对烦引的操作会造成锁表Q先生成一张时表Q将数据从原始表中写C时表Q再原始表删除Q最后将临时表表名改为原始表表名Q因增加、删除、修改字D会对主索引产生影响Q所以也会锁表。对secondary index?/span>Innodb plugin开始,支持快速烦引创建的ҎQ在创徏的过E中不需要重Q所以速度会很快,同时引擎会在表上?/span>S锁,在创E中只能q行L作?/span>

索引设计原则

1.       搜烦的烦引列Q不一定是所要选择的列。也是_最适合索引的列是出现在where子句中的列,或者连接子句中指定的列Q而不是出现在select关键字后的选择列表中的列?/span>

2.       使用唯一索引。考虑某列的分布,索引的列的基数越大,索引的效果越好。例如,Ҏ别M/F列做索引没多大用处?/span>

3.       使用短烦引。如果是对字W串q行索引Q如果有可能应该指定前缀长度?/span>

4.       利用最左前~。尽量将使用频繁且过滤效果好的字D|“左边”

5.       不要q度索引?/span>

6.       Innodb默认会按照一定的序保存数据Q如果明定义了主键Q则按照主键序保存。如果没有主键,但有唯一索引Q就按照唯一索引的顺序保存。如果有几个列都是唯一的,都可以作Z键的时候,Z提高查询效率Q应选择最常用讉K的列作ؓ主键。另外,innodb?/span>secondary index都会保存主键的键|所有主键要可能选择较短的数据类型。可以看出,应当量避免对主键的修改。经q?/span>dba的测试,保证主键的递增可以提高插入性能?/span>

 

Mysql如何使用索引

1.       对于创徏的多列烦引,只要查询的条件中用到了最左边的列Q烦引一般就会被使用?/span>

2.       对于使用like的查询,后面如果是常量ƈ且只?/span>%号不在第一个字W,索引才可能被使用?/span>

3.       如果对大文本q行搜烦Q应该用全文烦引,而不是?/span>like ‘%...%’. 但不q的?/span>innodb不支持全文烦引?/span>

4.       如果列名是烦引,使用 index_column is null用烦引?/span>Oracle是不行的?/span>

5.       如果mysql估计使用索引比全表扫描更慢,最不会使用索引?/span>

6.       如果使用memory/head表ƈ?/span>where条g中不使用”=”q行索引列,那么不会用到索引?/span>Head表只有在”=”的时候才会用烦引?/span>

7.       ?/span>or分割开的条Ӟ如果or前的条g中的列有索引Q而后面列中没有烦引,那么涉及到的索引都不会被用到?/span>

8.       不是多列索引的第一部分不会走烦引?/span>

9.       ?/span>%开始的like不会走烦?/span>

10.   如果列是字符Ԍ那么一定要?/span>where条g中把字符串常量值用引号引v来,否则不能走烦引。因为,mysql默认把输入的帔RD行{换以后才q行索?/span>

11.   l过普通运或函数q算后的索引字段不能使用索引

12.   不等于操作不能用烦Q?/span><>?/span>not in{?/span>

13.   Order by 优化Q某些情况下Q?/span>mysql可以使用一个烦引满?/span>order by,而不需要额外的排序?/span>Where条g?/span>order by 使用相同的烦引,q且order by的顺序和索引序相同Qƈ?/span>order by的字D都是升序或者都是降序?/span>

SELECT * FROM t1 ORDER BY key_part1,key_part2,... ;

SELECT * FROM t1 WHERE key_part1=1 ORDER BY key_part1 DESC, key_part2

DESC;

SELECT * FROM t1 ORDER BY key_part1 DESC, key_part2 DESC;

但是以下情况不用烦引:

SELECT * FROM t1 ORDER BY key_part1 DESC, key_part2 ASC Q?/span>

--order by 的字D|؜?/span> ASC ?/span> DESC

SELECT * FROM t1 WHERE key2=constant ORDER BY key1 Q?/span>

-- 用于查询行的关键字与 ORDER BY 中所使用的不相同

SELECT * FROM t1 ORDER BY key1, key2 Q?/span>

-- 对不同的关键字?/span> ORDER BY     

 

可以使用explain查看sql的执行计划?/span>



happyenjoylife 2011-12-17 16:36 发表评论
]]>
[转] Java bridge methods explainedhttp://www.tkk7.com/happyenjoylife/archive/2011/08/20/356919.htmlhappyenjoylifehappyenjoylifeSat, 20 Aug 2011 02:19:00 GMThttp://www.tkk7.com/happyenjoylife/archive/2011/08/20/356919.htmlhttp://www.tkk7.com/happyenjoylife/comments/356919.htmlhttp://www.tkk7.com/happyenjoylife/archive/2011/08/20/356919.html#Feedback0http://www.tkk7.com/happyenjoylife/comments/commentRss/356919.htmlhttp://www.tkk7.com/happyenjoylife/services/trackbacks/356919.htmlhttp://stas-blogspot.blogspot.com/2010/03/java-bridge-methods-explained.html
Bridge methods in Java are synthetic methods, which are necessary to implement some of Java language features. The best known samples are covariant return type and a case in generics when erasure of base method's arguments differs from the actual method being invoked.

Have a look at following example:

public class SampleOne {
public static class A<T> {
public T getT() {
return null;
}
}

public static class  B extends A<String> {
public String getT() {
return null;
}
}
}

Which in reality is just an example of covariant return type and after erasure will look like following snippet:

public class SampleOne {
public static class A {
public Object getT() {
return null;
}
}

public static class  B extends A {
public String getT() {
return null;
}
}
}

And after the compilation decompiled result class "B" will be following:
public class SampleOne$B extends SampleOne$A {
public SampleOne$B();

public java.lang.String getT();
Code:
0:   aconst_null
1:   areturn
public java.lang.Object getT();
Code:
0:   aload_0
1:   invokevirtual   #2// Call to Method getT:()Ljava/lang/String;
4:   areturn
}

Above you can see there is new synthetic method "java.lang.Object getT()" which is not present in source code. That method acts as bridge method and all is does is delegating invocation to "java.lang.String getT()". Compiler has to do that, because in JVM method return type is part of method's signature, and creation of bridge method is the way to implement covariant return type.

Now have a look at following example which is generics-specific:
public class SampleTwo {
public static class A<T> {
public T getT(T args) {
return args;
}

}


public static class B extends A<String> {
public String getT(String args) {
return args;
}

}

}

after compilation class "B" will be transformed into following:
public class SampleThree$B extends SampleThree$A{
public SampleThree$B();

public java.lang.String getT(java.lang.String);
Code:
0:   aload_1
1:   areturn

public java.lang.Object getT(java.lang.Object);
Code:
0:   aload_0
1:   aload_1
2:   checkcast       #2//class java/lang/String
5:   invokevirtual   #3//Method getT:(Ljava/lang/String;)Ljava/lang/String;
8:   areturn
}

here, the bridge method, which overrides method from base class "A", not just calling one with string argument (#3), but also performs type cast to "java.lang.String" (#2). It means, that if you will execute following code, ignoring compiler's "unchecked" warning, the result will be ClassCastException thrown from the bridge method:
A a = new B();
a.getT(
new Object()));

These two examples are the best known cases where bridge methods are used, but there is, at least, one more, where bridge method is used to "change" visibility of base class's methods. Have a look at following sample and try to guess where compiler may need the bridge method to be created:
package samplefour;

public class SampleFour {
static class A {
public void foo() {
}

}

public static class C extends A {

}

public static class D extends A {
public void foo() {
}

}

}
If you will decompile class C, you will see method "foo" there, which overrides method from base class and delegates to it:
public class SampleFour$C extends SampleFour$A{

public void foo();
Code:
0:   aload_0
1:   invokespecial   #2//Method SampleFour$A.foo:()V
4:   return

}

compiler needs that method, because class A is not public and can't be accessed outside it's package, but class C is public and all inherited method have to become visible outside the package as well. Note, that class D will not have bridge method, because it overrides "foo" and there is no need to "increase" visibility.
It looks like, that type of bridge method, was introduced after bug which was fixed in Java 6. It means that before Java 6 that type of bridge method is not generated and method "C#foo" can't be called from package other than it's own via reflection, so following snippet causes IllegalAccessException, in cases when compiled on Java version < 1.6:
package samplefive;

SampleFour.C.
class.getMethod("foo").invoke(new SampleFour.C());
Normal invocation, without using reflection, will work fine.

Probably there are some other cases where bridge methods are used, but there is no source of information about it. Also, there is no definition of bridge method, although you can guess it easily, it's pretty obvious from examples above, but still would be nice to have something in spec which states it clearly. In spite of the fact that method Method#isBridge() is part of public reflection API since Java1.5 and bridge flag is part of class file format, JVM and JLS specifications do not have any information what exactly is that and do not provide any rules when and how it should be used by compiler. All I could find is just reference in "Discussion" area here.


happyenjoylife 2011-08-20 10:19 发表评论
]]>
Jvm 学习——异常处?/title><link>http://www.tkk7.com/happyenjoylife/archive/2011/05/27/351175.html</link><dc:creator>happyenjoylife</dc:creator><author>happyenjoylife</author><pubDate>Fri, 27 May 2011 06:39:00 GMT</pubDate><guid>http://www.tkk7.com/happyenjoylife/archive/2011/05/27/351175.html</guid><wfw:comment>http://www.tkk7.com/happyenjoylife/comments/351175.html</wfw:comment><comments>http://www.tkk7.com/happyenjoylife/archive/2011/05/27/351175.html#Feedback</comments><slash:comments>4</slash:comments><wfw:commentRss>http://www.tkk7.com/happyenjoylife/comments/commentRss/351175.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/happyenjoylife/services/trackbacks/351175.html</trackback:ping><description><![CDATA[<h2><span>异常?/span></h2> <p><span style="font-family: 宋体">每一?/span>try<span style="font-family: 宋体">语句?/span>catch<span style="font-family: 宋体">的异帔R与异常表中的一相对应Q异常表中的每一w包括Q?/span></p> <ol><li> <div style="text-indent: -21pt; margin: 0cm 0cm 0pt 21pt"><span style="font-family: 宋体">L</span></div></li><li> <div style="text-indent: -21pt; margin: 0cm 0cm 0pt 21pt"><span style="font-family: 宋体">l点Q始l把</span>catch<span style="font-family: 宋体">异常位置?/span>pc<span style="font-family: 宋体">指针偏移量的最大值大Q?/span></div></li><li> <div style="text-indent: -21pt; margin: 0cm 0cm 0pt 21pt"><span style="font: 7pt 'Times New Roman'"> </span><span style="font-family: 宋体">处理异常时蟩转到的字节码序列中的</span>pc<span style="font-family: 宋体">指针偏移?/span></div></li><li> <div style="text-indent: -21pt; margin: 0cm 0cm 0pt 21pt"><span style="font: 7pt 'Times New Roman'"> </span><span style="font-family: 宋体">?/span>catch<span style="font-family: 宋体">的异常类的常量池索引</span></div></li></ol> <p> </p> <p><span style="font-family: 宋体">例如Q?/p> <div style="border-bottom: #cccccc 1px solid; border-left: #cccccc 1px solid; padding-bottom: 4px; background-color: #eeeeee; padding-left: 4px; width: 98%; padding-right: 5px; font-size: 13px; word-break: break-all; border-top: #cccccc 1px solid; border-right: #cccccc 1px solid; padding-top: 4px"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><img id="Codehighlighter1_18_180_Open_Image" onclick="this.style.display='none'; Codehighlighter1_18_180_Open_Text.style.display='none'; Codehighlighter1_18_180_Closed_Image.style.display='inline'; Codehighlighter1_18_180_Closed_Text.style.display='inline';" align="top" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif"><img style="display: none" id="Codehighlighter1_18_180_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_18_180_Closed_Text.style.display='none'; Codehighlighter1_18_180_Open_Image.style.display='inline'; Codehighlighter1_18_180_Open_Text.style.display='inline';" align="top" src="http://www.tkk7.com/images/OutliningIndicators/ContractedBlock.gif"><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">class</span><span style="color: #000000"> Test </span><span style="border-bottom: #808080 1px solid; border-left: #808080 1px solid; background-color: #ffffff; display: none; border-top: #808080 1px solid; border-right: #808080 1px solid" id="Codehighlighter1_18_180_Closed_Text"><img src="http://www.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_18_180_Open_Text"><span style="color: #000000">{<br /><img id="Codehighlighter1_60_178_Open_Image" onclick="this.style.display='none'; Codehighlighter1_60_178_Open_Text.style.display='none'; Codehighlighter1_60_178_Closed_Image.style.display='inline'; Codehighlighter1_60_178_Closed_Text.style.display='inline';" align="top" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif"><img style="display: none" id="Codehighlighter1_60_178_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_60_178_Closed_Text.style.display='none'; Codehighlighter1_60_178_Open_Image.style.display='inline'; Codehighlighter1_60_178_Open_Text.style.display='inline';" align="top" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif">    </span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">static</span><span style="color: #000000"> </span><span style="color: #0000ff">void</span><span style="color: #000000"> main(String[] args) </span><span style="border-bottom: #808080 1px solid; border-left: #808080 1px solid; background-color: #ffffff; display: none; border-top: #808080 1px solid; border-right: #808080 1px solid" id="Codehighlighter1_60_178_Closed_Text"><img src="http://www.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_60_178_Open_Text"><span style="color: #000000">{<br /><img align="top" src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" alt="" /><br /><img id="Codehighlighter1_69_111_Open_Image" onclick="this.style.display='none'; Codehighlighter1_69_111_Open_Text.style.display='none'; Codehighlighter1_69_111_Closed_Image.style.display='inline'; Codehighlighter1_69_111_Closed_Text.style.display='inline';" align="top" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif"><img style="display: none" id="Codehighlighter1_69_111_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_69_111_Closed_Text.style.display='none'; Codehighlighter1_69_111_Open_Image.style.display='inline'; Codehighlighter1_69_111_Open_Text.style.display='inline';" align="top" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif">        </span><span style="color: #0000ff">try</span><span style="color: #000000"> </span><span style="border-bottom: #808080 1px solid; border-left: #808080 1px solid; background-color: #ffffff; display: none; border-top: #808080 1px solid; border-right: #808080 1px solid" id="Codehighlighter1_69_111_Closed_Text"><img src="http://www.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_69_111_Open_Text"><span style="color: #000000">{<br /><img align="top" src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" alt="" />            Class.forName(</span><span style="color: #000000">"</span><span style="color: #000000">java.lang.String</span><span style="color: #000000">"</span><span style="color: #000000">);<br /><img id="Codehighlighter1_146_174_Open_Image" onclick="this.style.display='none'; Codehighlighter1_146_174_Open_Text.style.display='none'; Codehighlighter1_146_174_Closed_Image.style.display='inline'; Codehighlighter1_146_174_Closed_Text.style.display='inline';" align="top" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif"><img style="display: none" id="Codehighlighter1_146_174_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_146_174_Closed_Text.style.display='none'; Codehighlighter1_146_174_Open_Image.style.display='inline'; Codehighlighter1_146_174_Open_Text.style.display='inline';" align="top" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif">        }</span></span><span style="color: #000000"> </span><span style="color: #0000ff">catch</span><span style="color: #000000"> (ClassNotFoundException e) </span><span style="border-bottom: #808080 1px solid; border-left: #808080 1px solid; background-color: #ffffff; display: none; border-top: #808080 1px solid; border-right: #808080 1px solid" id="Codehighlighter1_146_174_Closed_Text"><img src="http://www.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_146_174_Open_Text"><span style="color: #000000">{<br /><img align="top" src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" alt="" />            e.printStackTrace();<br /><img align="top" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" alt="" />        }</span></span><span style="color: #000000"><br /><img align="top" src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" alt="" /><br /><img align="top" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" alt="" />    }</span></span><span style="color: #000000"><br /><img align="top" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockEnd.gif" alt="" />}</span></span><span style="color: #000000"><br /><img align="top" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" alt="" /></span></div> <p style="margin: 0cm 0cm 0pt" class="MsoNormal"><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">?/span><span lang="EN-US"><font face="Calibri">javap –c</font></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">查看字节码如下:</span><span lang="EN-US"><o:p></o:p></span></p> <p> </p> <div style="border-bottom: #cccccc 1px solid; border-left: #cccccc 1px solid; padding-bottom: 4px; background-color: #eeeeee; padding-left: 4px; width: 98%; padding-right: 5px; font-size: 13px; word-break: break-all; border-top: #cccccc 1px solid; border-right: #cccccc 1px solid; padding-top: 4px"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><img align="top" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" alt="" /><span style="color: #000000">Compiled from </span><span style="color: #000000">"</span><span style="color: #000000">Test.java</span><span style="color: #000000">"</span><span style="color: #000000"><br /><img id="Codehighlighter1_68_632_Open_Image" onclick="this.style.display='none'; Codehighlighter1_68_632_Open_Text.style.display='none'; Codehighlighter1_68_632_Closed_Image.style.display='inline'; Codehighlighter1_68_632_Closed_Text.style.display='inline';" align="top" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif"><img style="display: none" id="Codehighlighter1_68_632_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_68_632_Closed_Text.style.display='none'; Codehighlighter1_68_632_Open_Image.style.display='inline'; Codehighlighter1_68_632_Open_Text.style.display='inline';" align="top" src="http://www.tkk7.com/images/OutliningIndicators/ContractedBlock.gif"></span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">class</span><span style="color: #000000"> Test </span><span style="color: #0000ff">extends</span><span style="color: #000000"> java.lang.Object</span><span style="border-bottom: #808080 1px solid; border-left: #808080 1px solid; background-color: #ffffff; display: none; border-top: #808080 1px solid; border-right: #808080 1px solid" id="Codehighlighter1_68_632_Closed_Text"><img src="http://www.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_68_632_Open_Text"><span style="color: #000000">{<br /><img align="top" src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" alt="" /></span><span style="color: #0000ff">public</span><span style="color: #000000"> Test();<br /><img align="top" src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" alt="" />  Code:<br /><img align="top" src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" alt="" />   </span><span style="color: #000000">0</span><span style="color: #000000">:    aload_0<br /><img align="top" src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" alt="" />   </span><span style="color: #000000">1</span><span style="color: #000000">:    invokespecial    #</span><span style="color: #000000">1</span><span style="color: #000000">; </span><span style="color: #008000">//</span><span style="color: #008000">Method java/lang/Object."<init>":()V</span><span style="color: #008000"><br /><img align="top" src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" alt="" /></span><span style="color: #000000">   </span><span style="color: #000000">4</span><span style="color: #000000">:    </span><span style="color: #0000ff">return</span><span style="color: #000000"><br /><img align="top" src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" alt="" /><br /><img align="top" src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" alt="" /></span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">static</span><span style="color: #000000"> </span><span style="color: #0000ff">void</span><span style="color: #000000"> main(java.lang.String[]);<br /><img align="top" src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" alt="" />  Code:<br /><img align="top" src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" alt="" />   </span><span style="color: #000000">0</span><span style="color: #000000">:    ldc    #</span><span style="color: #000000">2</span><span style="color: #000000">; </span><span style="color: #008000">//</span><span style="color: #008000">String java.lang.String</span><span style="color: #008000"><br /><img align="top" src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" alt="" /></span><span style="color: #000000">   </span><span style="color: #000000">2</span><span style="color: #000000">:    invokestatic    #</span><span style="color: #000000">3</span><span style="color: #000000">; </span><span style="color: #008000">//</span><span style="color: #008000">Method java/lang/Class.forName:(Ljava/lang/String;)Ljava/lang/Class;</span><span style="color: #008000"><br /><img align="top" src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" alt="" /></span><span style="color: #000000">   </span><span style="color: #000000">5</span><span style="color: #000000">:    pop    <br /><img align="top" src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" alt="" />   </span><span style="color: #000000">6</span><span style="color: #000000">:    </span><span style="color: #0000ff">goto</span><span style="color: #000000">    </span><span style="color: #000000">14</span><span style="color: #000000"><br /><img align="top" src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" alt="" />   </span><span style="color: #000000">9</span><span style="color: #000000">:    astore_1<br /><img align="top" src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" alt="" />   </span><span style="color: #000000">10</span><span style="color: #000000">:    aload_1<br /><img align="top" src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" alt="" />   </span><span style="color: #000000">11</span><span style="color: #000000">:    invokevirtual    #</span><span style="color: #000000">5</span><span style="color: #000000">; </span><span style="color: #008000">//</span><span style="color: #008000">Method java/lang/ClassNotFoundException.printStackTrace:()V</span><span style="color: #008000"><br /><img align="top" src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" alt="" /></span><span style="color: #000000">   </span><span style="color: #000000">14</span><span style="color: #000000">:    </span><span style="color: #0000ff">return</span><span style="color: #000000"><br /><img align="top" src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" alt="" />  Exception table:<br /><img align="top" src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" alt="" />   from   to  target type<br /><img align="top" src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" alt="" />     </span><span style="color: #000000">0</span><span style="color: #000000">     </span><span style="color: #000000">6</span><span style="color: #000000">     </span><span style="color: #000000">9</span><span style="color: #000000">   Class java</span><span style="color: #000000">/</span><span style="color: #000000">lang</span><span style="color: #000000">/</span><span style="color: #000000">ClassNotFoundException<br /><img align="top" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockEnd.gif" alt="" />}</span></span><span style="color: #000000"><br /><img align="top" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" alt="" /></span></div> <p> </p> <p><span style="font-family: 宋体">可见</span>ClassNotFoundException<span style="font-family: 宋体">异常可能会在</span>0~6<span style="font-family: 宋体">之间抛出Q?/span>9<span style="font-family: 宋体">开始处的代码处理此异常?/span></p> <p> </p> <p><span style="font-family: 宋体">当生异常的时候,</span>jvm<span style="font-family: 宋体">会在整个异常表中搜索与之匹配的,如果当前</span>pc<span style="font-family: 宋体">在异常表入口所指的范围内,q且所抛出的异常是此入口所指向的类或者其子类Q则跌{到对应的处理代码l箋执行?/span></p> <p> </p> <h2><span style="font-family: 宋体">Ҏ可能会抛出哪些已查异?/span></h2> <p>Class<span style="font-family: 宋体">文g?/span>attribute_info<span style="font-family: 宋体">中保存有</span>Exceptions<span style="font-family: 宋体">属性,记录着每个Ҏ</span>throws<span style="font-family: 宋体">的异怿息。具体的可以查看</span>class<span style="font-family: 宋体">cL件格式相关的文章?/span></p> <p> </p> <p>athrow<span style="font-family: 宋体">指o从栈弹?/span>Throwable<span style="font-family: 宋体">对象引用Q抛出异常?/span></p> <p> </p> <h2>finally<span style="font-family: 宋体">语句</span></h2> <p><span style="font-family: 宋体">?/span>jvm<span style="font-family: 宋体">规范中,</span>finally<span style="font-family: 宋体">语句是通过</span>jsr/jsr_w<span style="font-family: 宋体">?/span>ret<span style="font-family: 宋体">指o实现的。当执行</span>jsr/jsr_w<span style="font-family: 宋体">的时候将</span>finally<span style="font-family: 宋体">执行完成后的q回地址压入栈中Q进?/span>finally<span style="font-family: 宋体">后会马上此地址保存C个局部变量中Q执行完成后Q?/span>ret<span style="font-family: 宋体">从此局部变量中取出q回地址。?Q?Z么会先把q回地址保存到局部变量中呢?Q?因ؓQ当?/span>finally<span style="font-family: 宋体">语句q回的时候需要将q回地址成栈中弹出,?/span>finally<span style="font-family: 宋体">语句非正常结?/span>(break,continue,return, <span style="font-family: 宋体">抛异?/span>)<span style="font-family: 宋体">的时候就不用再考虑q个问题?/span></p> <p> </p> <p><span style="font-family: 宋体; font-size: 10.5pt">以下?/span><span style="font-family: 'Calibri','sans-serif'; font-size: 10.5pt">jvm</span><span style="font-family: 宋体; font-size: 10.5pt">规范?/span><span style="font-family: 'Calibri','sans-serif'; font-size: 10.5pt">Compiling finally</span><span style="font-family: 宋体; font-size: 10.5pt">的一D:</p> <div style="border-bottom: #cccccc 1px solid; border-left: #cccccc 1px solid; padding-bottom: 4px; background-color: #eeeeee; padding-left: 4px; width: 98%; padding-right: 5px; font-size: 13px; word-break: break-all; border-top: #cccccc 1px solid; border-right: #cccccc 1px solid; padding-top: 4px"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><img id="Codehighlighter1_18_92_Open_Image" onclick="this.style.display='none'; Codehighlighter1_18_92_Open_Text.style.display='none'; Codehighlighter1_18_92_Closed_Image.style.display='inline'; Codehighlighter1_18_92_Closed_Text.style.display='inline';" align="top" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif"><img style="display: none" id="Codehighlighter1_18_92_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_18_92_Closed_Text.style.display='none'; Codehighlighter1_18_92_Open_Image.style.display='inline'; Codehighlighter1_18_92_Open_Text.style.display='inline';" align="top" src="http://www.tkk7.com/images/OutliningIndicators/ContractedBlock.gif"><span style="color: #0000ff">void</span><span style="color: #000000"> tryFinally() </span><span style="border-bottom: #808080 1px solid; border-left: #808080 1px solid; background-color: #ffffff; display: none; border-top: #808080 1px solid; border-right: #808080 1px solid" id="Codehighlighter1_18_92_Closed_Text"><img src="http://www.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_18_92_Open_Text"><span style="color: #000000">{<br /><img id="Codehighlighter1_28_54_Open_Image" onclick="this.style.display='none'; Codehighlighter1_28_54_Open_Text.style.display='none'; Codehighlighter1_28_54_Closed_Image.style.display='inline'; Codehighlighter1_28_54_Closed_Text.style.display='inline';" align="top" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif"><img style="display: none" id="Codehighlighter1_28_54_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_28_54_Closed_Text.style.display='none'; Codehighlighter1_28_54_Open_Image.style.display='inline'; Codehighlighter1_28_54_Open_Text.style.display='inline';" align="top" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif">    </span><span style="color: #0000ff">try</span><span style="color: #000000"> </span><span style="border-bottom: #808080 1px solid; border-left: #808080 1px solid; background-color: #ffffff; display: none; border-top: #808080 1px solid; border-right: #808080 1px solid" id="Codehighlighter1_28_54_Closed_Text"><img src="http://www.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_28_54_Open_Text"><span style="color: #000000">{<br /><img align="top" src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" alt="" />        tryItOut();<br /><img id="Codehighlighter1_64_90_Open_Image" onclick="this.style.display='none'; Codehighlighter1_64_90_Open_Text.style.display='none'; Codehighlighter1_64_90_Closed_Image.style.display='inline'; Codehighlighter1_64_90_Closed_Text.style.display='inline';" align="top" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif"><img style="display: none" id="Codehighlighter1_64_90_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_64_90_Closed_Text.style.display='none'; Codehighlighter1_64_90_Open_Image.style.display='inline'; Codehighlighter1_64_90_Open_Text.style.display='inline';" align="top" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif">    }</span></span><span style="color: #000000"> </span><span style="color: #0000ff">finally</span><span style="color: #000000"> </span><span style="border-bottom: #808080 1px solid; border-left: #808080 1px solid; background-color: #ffffff; display: none; border-top: #808080 1px solid; border-right: #808080 1px solid" id="Codehighlighter1_64_90_Closed_Text"><img src="http://www.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_64_90_Open_Text"><span style="color: #000000">{<br /><img align="top" src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" alt="" />        wrapItUp();<br /><img align="top" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" alt="" />    }</span></span><span style="color: #000000"><br /><img align="top" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockEnd.gif" alt="" />}</span></span><span style="color: #000000"><br /><img align="top" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" alt="" />the compiled code is<br /><img align="top" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" alt="" />Method </span><span style="color: #0000ff">void</span><span style="color: #000000"> tryFinally()<br /><img align="top" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" alt="" />   </span><span style="color: #000000">0</span><span style="color: #000000">     aload_0            </span><span style="color: #008000">//</span><span style="color: #008000"> Beginning of try block</span><span style="color: #008000"><br /><img align="top" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" alt="" /></span><span style="color: #000000">   </span><span style="color: #000000">1</span><span style="color: #000000">    invokevirtual #</span><span style="color: #000000">6</span><span style="color: #000000">         </span><span style="color: #008000">//</span><span style="color: #008000"> Method Example.tryItOut()V</span><span style="color: #008000"><br /><img align="top" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" alt="" /></span><span style="color: #000000">   </span><span style="color: #000000">4</span><span style="color: #000000">     jsr </span><span style="color: #000000">14</span><span style="color: #000000">            </span><span style="color: #008000">//</span><span style="color: #008000"> Call finally block</span><span style="color: #008000"><br /><img align="top" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" alt="" /></span><span style="color: #000000">   </span><span style="color: #000000">7</span><span style="color: #000000">     </span><span style="color: #0000ff">return</span><span style="color: #000000">            </span><span style="color: #008000">//</span><span style="color: #008000"> End of try block</span><span style="color: #008000"><br /><img align="top" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" alt="" /></span><span style="color: #000000">   </span><span style="color: #000000">8</span><span style="color: #000000">     astore_1            </span><span style="color: #008000">//</span><span style="color: #008000"> Beginning of handler for any throw</span><span style="color: #008000"><br /><img align="top" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" alt="" /></span><span style="color: #000000">   </span><span style="color: #000000">9</span><span style="color: #000000">     jsr </span><span style="color: #000000">14</span><span style="color: #000000">            </span><span style="color: #008000">//</span><span style="color: #008000"> Call finally block</span><span style="color: #008000"><br /><img align="top" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" alt="" /></span><span style="color: #000000">  </span><span style="color: #000000">12</span><span style="color: #000000">     aload_1            </span><span style="color: #008000">//</span><span style="color: #008000"> Push thrown value</span><span style="color: #008000"><br /><img align="top" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" alt="" /></span><span style="color: #000000">  </span><span style="color: #000000">13</span><span style="color: #000000">     athrow            </span><span style="color: #008000">//</span><span style="color: #008000"> <img src="http://www.tkk7.com/Images/dot.gif" alt="" />and rethrow the value to the invoker</span><span style="color: #008000"><br /><img align="top" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" alt="" /></span><span style="color: #000000">  </span><span style="color: #000000">14</span><span style="color: #000000">     astore_2            </span><span style="color: #008000">//</span><span style="color: #008000"> Beginning of finally block</span><span style="color: #008000"><br /><img align="top" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" alt="" /></span><span style="color: #000000">  </span><span style="color: #000000">15</span><span style="color: #000000">     aload_0            </span><span style="color: #008000">//</span><span style="color: #008000"> Push this</span><span style="color: #008000"><br /><img align="top" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" alt="" /></span><span style="color: #000000">  </span><span style="color: #000000">16</span><span style="color: #000000">     invokevirtual #</span><span style="color: #000000">5</span><span style="color: #000000">         </span><span style="color: #008000">//</span><span style="color: #008000"> Method Example.wrapItUp()V</span><span style="color: #008000"><br /><img align="top" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" alt="" /></span><span style="color: #000000">  </span><span style="color: #000000">19</span><span style="color: #000000">     ret </span><span style="color: #000000">2</span><span style="color: #000000">            </span><span style="color: #008000">//</span><span style="color: #008000"> Return from finally block</span><span style="color: #008000"><br /><img align="top" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" alt="" /></span><span style="color: #000000">Exception table:<br /><img align="top" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" alt="" />       From     To     Target         Type<br /><img align="top" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" alt="" />    </span><span style="color: #000000">0</span><span style="color: #000000">        </span><span style="color: #000000">4</span><span style="color: #000000">        </span><span style="color: #000000">8</span><span style="color: #000000">           any<br /><img align="top" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" alt="" /></span></div> <p></span> </p> <p><span style="font-family: 宋体">?/span>tryItOut<span style="font-family: 宋体">排除M异常后都会被异常表中的</span>any<span style="font-family: 宋体">ҎP执行?/span>finally<span style="font-family: 宋体">后,会执?/span>athrow<span style="font-family: 宋体">指o异常抛出?/span></p> <p> </p> <p><span style="font-family: 宋体">?/span>jdk<span style="font-family: 宋体">的某一个版本开始就不会~译出编译出?/span>jsr/jsr_w<span style="font-family: 宋体">?/span>ret<span style="font-family: 宋体">的字节码了,因ؓ有指令上的缺PD</span>jvm<span style="font-family: 宋体">的检验和分析pȝ出现漏洞?/span></p> <p> </p> <h2><span style="font-family: 宋体">再说</span>finally<span style="font-family: 宋体">的非正常退?/span></h2> <p><span style="font-family: 宋体">?/span>finally<span style="font-family: 宋体">中?/span>break<span style="font-family: 宋体">?/span>continue<span style="font-family: 宋体">?/span>return<span style="font-family: 宋体">、抛出异常等认ؓ?/span>finally<span style="font-family: 宋体">的非正常l束。非正常l束的时候,</span>ret<span style="font-family: 宋体">指o不会被执行,很可能会出现意想不到的结果。如Q?/span></p> <p> </p> <div style="border-bottom: #cccccc 1px solid; border-left: #cccccc 1px solid; padding-bottom: 4px; background-color: #eeeeee; padding-left: 4px; width: 98%; padding-right: 5px; font-size: 13px; word-break: break-all; border-top: #cccccc 1px solid; border-right: #cccccc 1px solid; padding-top: 4px"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><img id="Codehighlighter1_18_428_Open_Image" onclick="this.style.display='none'; Codehighlighter1_18_428_Open_Text.style.display='none'; Codehighlighter1_18_428_Closed_Image.style.display='inline'; Codehighlighter1_18_428_Closed_Text.style.display='inline';" align="top" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif"><img style="display: none" id="Codehighlighter1_18_428_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_18_428_Closed_Text.style.display='none'; Codehighlighter1_18_428_Open_Image.style.display='inline'; Codehighlighter1_18_428_Open_Text.style.display='inline';" align="top" src="http://www.tkk7.com/images/OutliningIndicators/ContractedBlock.gif"><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">class</span><span style="color: #000000"> Test </span><span style="border-bottom: #808080 1px solid; border-left: #808080 1px solid; background-color: #ffffff; display: none; border-top: #808080 1px solid; border-right: #808080 1px solid" id="Codehighlighter1_18_428_Closed_Text"><img src="http://www.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_18_428_Open_Text"><span style="color: #000000">{<br /><img id="Codehighlighter1_59_346_Open_Image" onclick="this.style.display='none'; Codehighlighter1_59_346_Open_Text.style.display='none'; Codehighlighter1_59_346_Closed_Image.style.display='inline'; Codehighlighter1_59_346_Closed_Text.style.display='inline';" align="top" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif"><img style="display: none" id="Codehighlighter1_59_346_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_59_346_Closed_Text.style.display='none'; Codehighlighter1_59_346_Open_Image.style.display='inline'; Codehighlighter1_59_346_Open_Text.style.display='inline';" align="top" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif">    </span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">static</span><span style="color: #000000"> </span><span style="color: #0000ff">boolean</span><span style="color: #000000"> test(</span><span style="color: #0000ff">boolean</span><span style="color: #000000"> b) </span><span style="border-bottom: #808080 1px solid; border-left: #808080 1px solid; background-color: #ffffff; display: none; border-top: #808080 1px solid; border-right: #808080 1px solid" id="Codehighlighter1_59_346_Closed_Text"><img src="http://www.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_59_346_Open_Text"><span style="color: #000000">{<br /><img id="Codehighlighter1_73_326_Open_Image" onclick="this.style.display='none'; Codehighlighter1_73_326_Open_Text.style.display='none'; Codehighlighter1_73_326_Closed_Image.style.display='inline'; Codehighlighter1_73_326_Closed_Text.style.display='inline';" align="top" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif"><img style="display: none" id="Codehighlighter1_73_326_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_73_326_Closed_Text.style.display='none'; Codehighlighter1_73_326_Open_Image.style.display='inline'; Codehighlighter1_73_326_Open_Text.style.display='inline';" align="top" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif">        </span><span style="color: #0000ff">while</span><span style="color: #000000"> (b) </span><span style="border-bottom: #808080 1px solid; border-left: #808080 1px solid; background-color: #ffffff; display: none; border-top: #808080 1px solid; border-right: #808080 1px solid" id="Codehighlighter1_73_326_Closed_Text"><img src="http://www.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_73_326_Open_Text"><span style="color: #000000">{<br /><img id="Codehighlighter1_82_104_Open_Image" onclick="this.style.display='none'; Codehighlighter1_82_104_Open_Text.style.display='none'; Codehighlighter1_82_104_Closed_Image.style.display='inline'; Codehighlighter1_82_104_Closed_Text.style.display='inline';" align="top" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif"><img style="display: none" id="Codehighlighter1_82_104_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_82_104_Closed_Text.style.display='none'; Codehighlighter1_82_104_Open_Image.style.display='inline'; Codehighlighter1_82_104_Open_Text.style.display='inline';" align="top" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif">            </span><span style="color: #0000ff">try</span><span style="color: #000000"> </span><span style="border-bottom: #808080 1px solid; border-left: #808080 1px solid; background-color: #ffffff; display: none; border-top: #808080 1px solid; border-right: #808080 1px solid" id="Codehighlighter1_82_104_Closed_Text"><img src="http://www.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_82_104_Open_Text"><span style="color: #000000">{<br /><img align="top" src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" alt="" />                </span><span style="color: #0000ff">return</span><span style="color: #000000"> </span><span style="color: #0000ff">true</span><span style="color: #000000">;<br /><img id="Codehighlighter1_114_322_Open_Image" onclick="this.style.display='none'; Codehighlighter1_114_322_Open_Text.style.display='none'; Codehighlighter1_114_322_Closed_Image.style.display='inline'; Codehighlighter1_114_322_Closed_Text.style.display='inline';" align="top" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif"><img style="display: none" id="Codehighlighter1_114_322_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_114_322_Closed_Text.style.display='none'; Codehighlighter1_114_322_Open_Image.style.display='inline'; Codehighlighter1_114_322_Open_Text.style.display='inline';" align="top" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif">            }</span></span><span style="color: #000000"> </span><span style="color: #0000ff">finally</span><span style="color: #000000"> </span><span style="border-bottom: #808080 1px solid; border-left: #808080 1px solid; background-color: #ffffff; display: none; border-top: #808080 1px solid; border-right: #808080 1px solid" id="Codehighlighter1_114_322_Closed_Text"><img src="http://www.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_114_322_Open_Text"><span style="color: #000000">{<br /><img id="Codehighlighter1_120_317_Open_Image" onclick="this.style.display='none'; Codehighlighter1_120_317_Open_Text.style.display='none'; Codehighlighter1_120_317_Closed_Image.style.display='inline'; Codehighlighter1_120_317_Closed_Text.style.display='inline';" align="top" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif"><img style="display: none" id="Codehighlighter1_120_317_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_120_317_Closed_Text.style.display='none'; Codehighlighter1_120_317_Open_Image.style.display='inline'; Codehighlighter1_120_317_Open_Text.style.display='inline';" align="top" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif">                </span><span style="border-bottom: #808080 1px solid; border-left: #808080 1px solid; background-color: #ffffff; display: none; border-top: #808080 1px solid; border-right: #808080 1px solid" id="Codehighlighter1_120_317_Closed_Text">/**/</span><span id="Codehighlighter1_120_317_Open_Text"><span style="color: #008000">/*</span><span style="color: #008000"><br /><img align="top" src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" alt="" />                break;                          始终q回false<br /><img align="top" src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" alt="" />                continue;                         javac~译再java执行会出现死循环<br /><img align="top" src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" alt="" />                                                在eclipse中甚至会出现报错Q提C找Cmain class<br /><img align="top" src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" alt="" />                return false;                     始终q回false<br /><img align="top" src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" alt="" />                throw new RuntimeException("");    抛出异常<br /><img align="top" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" alt="" />                 </span><span style="color: #008000">*/</span></span><span style="color: #000000"><br /><img align="top" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" alt="" />            }</span></span><span style="color: #000000"><br /><img align="top" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" alt="" />        }</span></span><span style="color: #000000"><br /><img align="top" src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" alt="" /><br /><img align="top" src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" alt="" />        </span><span style="color: #0000ff">return</span><span style="color: #000000"> </span><span style="color: #0000ff">false</span><span style="color: #000000">;<br /><img align="top" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" alt="" />    }</span></span><span style="color: #000000"><br /><img align="top" src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" alt="" /><br /><img id="Codehighlighter1_389_426_Open_Image" onclick="this.style.display='none'; Codehighlighter1_389_426_Open_Text.style.display='none'; Codehighlighter1_389_426_Closed_Image.style.display='inline'; Codehighlighter1_389_426_Closed_Text.style.display='inline';" align="top" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif"><img style="display: none" id="Codehighlighter1_389_426_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_389_426_Closed_Text.style.display='none'; Codehighlighter1_389_426_Open_Image.style.display='inline'; Codehighlighter1_389_426_Open_Text.style.display='inline';" align="top" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif">    </span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">static</span><span style="color: #000000"> </span><span style="color: #0000ff">void</span><span style="color: #000000"> main(String[] args) </span><span style="border-bottom: #808080 1px solid; border-left: #808080 1px solid; background-color: #ffffff; display: none; border-top: #808080 1px solid; border-right: #808080 1px solid" id="Codehighlighter1_389_426_Closed_Text"><img src="http://www.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_389_426_Open_Text"><span style="color: #000000">{<br /><img align="top" src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" alt="" />        System.out.println(test(</span><span style="color: #0000ff">true</span><span style="color: #000000">));<br /><img align="top" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" alt="" />    }</span></span><span style="color: #000000"><br /><img align="top" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockEnd.gif" alt="" />}</span></span><span style="color: #000000"><br /><img align="top" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" alt="" /></span></div> <p><br /><span style="font-family: 宋体; color: black; font-size: 10pt; mso-ascii-font-family: 'Courier New'; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">Q在?/span><span style="font-family: 'Courier New'; color: black; font-size: 10pt; mso-font-kerning: 0pt" lang="EN-US">finally</span><span style="font-family: 宋体; color: black; font-size: 10pt; mso-ascii-font-family: 'Courier New'; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">语句的时候,量避免非正常结束!</span><span style="font-family: 'Courier New'; color: black; font-size: 10pt; mso-font-kerning: 0pt" lang="EN-US"><o:p></o:p></span></p> <p><br /></span> </p> <img src ="http://www.tkk7.com/happyenjoylife/aggbug/351175.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/happyenjoylife/" target="_blank">happyenjoylife</a> 2011-05-27 14:39 <a href="http://www.tkk7.com/happyenjoylife/archive/2011/05/27/351175.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>分库分表ȝhttp://www.tkk7.com/happyenjoylife/archive/2011/05/13/350177.htmlhappyenjoylifehappyenjoylifeFri, 13 May 2011 07:31:00 GMThttp://www.tkk7.com/happyenjoylife/archive/2011/05/13/350177.htmlhttp://www.tkk7.com/happyenjoylife/comments/350177.htmlhttp://www.tkk7.com/happyenjoylife/archive/2011/05/13/350177.html#Feedback4http://www.tkk7.com/happyenjoylife/comments/commentRss/350177.htmlhttp://www.tkk7.com/happyenjoylife/services/trackbacks/350177.html单库单表

单库单表是最常见的数据库设计Q例如,有一张用?span lang="EN-US">(user)表放在数据库db中,所有的用户都可以在db库中?span lang="EN-US">user表中查到?/p>

 

单库多表

随着用户数量的增加,user表的数据量会来大Q当数据量达C定程度的时候对user表的查询会渐渐的变慢Q从而媄响整?span lang="EN-US">DB的性能。如果?span lang="EN-US">mysql, q有一个更严重的问题是Q当需要添加一列的时候,mysql会锁表,期间所有的d操作只能{待?/p>

可以通过某种方式?span lang="EN-US">userq行水^的切分,产生两个表结构完全一Luser_0000,user_0001{表Q?span lang="EN-US">user_0000 + user_0001 + …的数据刚好是一份完整的数据?/p>

 

多库多表

         随着数据量增加也许单?span lang="EN-US">DB的存储空间不够,随着查询量的增加单台数据库服务器已经没办法支撑。这个时候可以再Ҏ据库q行水^区分?/p>

 

分库分表规则

         设计表的时候需要确定此表按照什么样的规则进行分库分表。例如,当有新用hQ程序得定此用户信息d到哪个表中;同理Q当d的时候我们得通过用户的̎h到数据库中对应的记录Q所有的q些都需要按照某一规则q行?/p>

路由

         通过分库分表规则查找到对应的表和库的q程。如分库分表的规则是user_id mod 4的方式,当用h注册了一个̎P账号id?span lang="EN-US">123,我们可以通过id mod 4的方式确定此账号应该保存?span lang="EN-US">User_0003表中。当用户123d的时候,我们通过123 mod 4后确定记录在User_0003中?/p>

分库分表产生的问题,及注意事?/h2>

1.   分库分表l度的问?/p>

假如用户购买了商?span lang="EN-US">,需要将交易记录保存取来Q如果按照用LU度分表Q则每个用户的交易记录都保存在同一表中Q所以很快很方便的查扑ֈ某用L购买情况Q但是某商品被购买的情况则很有可能分布在多张表中Q查找v来比较麻烦。反之,按照商品l度分表Q可以很方便的查扑ֈ此商品的购买情况Q但要查扑ֈCh的交易记录比较麻烦?/p>

 

所以常见的解决方式有:

     a.通过扫表的方式解冻I此方法基本不可能Q效率太低了?/p>

     b.记录两䆾数据Q一份按照用L度分表,一份按照商品维度分表?/p>

     c.通过搜烦引擎解决Q但如果实时性要求很高,又得关系到实时搜索?/p>

 

2.   联合查询的问?/p>

联合查询基本不可能,因ؓ兌的表有可能不在同一数据库中?/p>

 

3.   避免跨库事务

避免在一个事务中修改db0中的表的时候同时修?span lang="EN-US">db1中的表,一个是操作h更复杂,效率也会有一定媄响?/p>

 

4.   量把同一l数据放到同一DB服务器上

例如卖?span lang="EN-US">a的商品和交易信息都放?span lang="EN-US">db0中,?span lang="EN-US">db1挂了的时候,卖家a相关的东西可以正怋用。也是说避免数据库中的数据依赖另一数据库中的数据?/p>

 

 

一d?/h2>

在实际的应用中,l大部分情况都是读远大于写?span lang="EN-US">Mysql提供了读写分ȝ机制Q所有的写操作都必须对应?span lang="EN-US">MasterQ读操作可以?span lang="EN-US">Master?span lang="EN-US">Slave机器上进行,Slave?span lang="EN-US">Master的结构完全一P一?span lang="EN-US">Master可以有多?span lang="EN-US">Slave,甚至Slave下还可以?span lang="EN-US">Slave,通过此方式可以有效的提高DB集群?span lang="EN-US">QPS.                                                       

所有的写操作都是先?span lang="EN-US">Master上操作,然后同步更新?span lang="EN-US">Slave上,所以从Master同步?span lang="EN-US">Slave机器有一定的延迟Q当pȝ很繁忙的时候,延迟问题会更加严重,Slave机器数量的增加也会ɘq个问题更加严重?/p>

此外Q可以看?span lang="EN-US">Master是集的瓉Q当写操作过多,会严重媄响到Master的稳定性,如果Master挂掉Q整个集都不能正常工作?/p>

所以,1. 当读压力很大的时候,可以考虑dSlave机器的分式解冻I但是?span lang="EN-US">Slave机器辑ֈ一定的数量得考虑分库了?span lang="EN-US"> 2. 当写压力很大的时候,必dq行分库操作?/p>

 

         另外Q可能会因ؓU种原因Q集中的数据库g配置{会不一P某些性能高,某些性能低,q个时候可以通过E序控制每台机器d的比重,辑ֈ负蝲均衡?/p>


备䆾地址Q?span style="font-family: Simsun; line-height: normal; font-size: medium; ">http://happyenjoylife.iteye.com/admin/blogs/1042538



happyenjoylife 2011-05-13 15:31 发表评论
]]>IE下修改hosts不用重启的方?/title><link>http://www.tkk7.com/happyenjoylife/archive/2011/01/03/342223.html</link><dc:creator>happyenjoylife</dc:creator><author>happyenjoylife</author><pubDate>Mon, 03 Jan 2011 12:21:00 GMT</pubDate><guid>http://www.tkk7.com/happyenjoylife/archive/2011/01/03/342223.html</guid><wfw:comment>http://www.tkk7.com/happyenjoylife/comments/342223.html</wfw:comment><comments>http://www.tkk7.com/happyenjoylife/archive/2011/01/03/342223.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/happyenjoylife/comments/commentRss/342223.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/happyenjoylife/services/trackbacks/342223.html</trackback:ping><description><![CDATA[XP下试q,保存h怕将来忘?<br /> <br /> HKeyCurrentUser"SOFTWARE"Microsoft"Windows"CurrentVersion"Internet Settings <br /> 增加Q?br /> DnsCacheEnabled  0x0 (REG_DWORD) <br /> DnsCacheTimeout 0x0 (REG_DWORD) <br /> ServerInfoTimeOut 0x0 (REG_DWORD) <img src ="http://www.tkk7.com/happyenjoylife/aggbug/342223.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/happyenjoylife/" target="_blank">happyenjoylife</a> 2011-01-03 20:21 <a href="http://www.tkk7.com/happyenjoylife/archive/2011/01/03/342223.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Ubuntu10.04下build OpenJDK7 的过E?/title><link>http://www.tkk7.com/happyenjoylife/archive/2011/01/03/342218.html</link><dc:creator>happyenjoylife</dc:creator><author>happyenjoylife</author><pubDate>Mon, 03 Jan 2011 11:46:00 GMT</pubDate><guid>http://www.tkk7.com/happyenjoylife/archive/2011/01/03/342218.html</guid><wfw:comment>http://www.tkk7.com/happyenjoylife/comments/342218.html</wfw:comment><comments>http://www.tkk7.com/happyenjoylife/archive/2011/01/03/342218.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/happyenjoylife/comments/commentRss/342218.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/happyenjoylife/services/trackbacks/342218.html</trackback:ping><description><![CDATA[<!--[if gte mso 9]><![endif]--><!--[if gte mso 9]><xml> Normal 0 7.8 ? 0 2 false false false EN-US ZH-CN X-NONE </xml><![endif]--><!--[if gte mso 9]><![endif]--><!--[if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable { mso-style-parent:""; font-size:10.5pt; font-family:"Calibri","sans-serif"; mso-bidi-font-family:"Times New Roman";} </style> <![endif]--> <p style="margin-left: 18pt; text-indent: -18pt;"><span><span>1.<span style="font: 7pt "Times New Roman";">       </span></span></span><span style="font-family: 宋体;">安装</span>mercurial</p> <p style="margin-left: 18pt; text-indent: 0cm;">Mercurial<span style="font-family: 宋体;">是一个版本管理工兗?/span></p> <p style="margin-left: 18pt; text-indent: 0cm;">sudo apt-get install mercurial</p> <p style="margin-left: 18pt; text-indent: 0cm;"><span style="font-family: 宋体;">安装</span>mercurial<span style="font-family: 宋体;">的扩展,d</span>fclone<span style="font-family: 宋体;">在支?/span></p> <p style="text-indent: 18pt;"><span>hg clone http://bitbucket.org/pmezard/hgforest-crew</span></p> <p style="margin-left: 18pt; text-indent: 0cm;"><span style="font-family: 宋体;">以下内Ҏ加到</span>$HOME/.hgrc<span style="font-family: 宋体;">文g中,如果没有则自己创Z个:</span></p> <p style="margin-left: 10.5pt;">[extensions]</p> <p style="margin-left: 10.5pt;">forest=/home/daren/hgforest-crew/forest.py</p> <p style="margin-left: 28.5pt; text-indent: 3pt;">fetch=</p> <p style="margin-left: 18pt; text-indent: -18pt;"><span><span>2.<span style="font: 7pt "Times New Roman";">       </span></span></span><span style="font-family: 宋体;">下蝲</span>jdk7<span style="font-family: 宋体;">源码</span></p> <p style="margin-left: 18pt; text-indent: 0cm;">hg fclone <a >http://hg.openjdk.java.net/jdk7/jdk7</a></p> <p style="margin-left: 18pt; text-indent: -18pt;"><span><span>3.<span style="font: 7pt "Times New Roman";">       </span></span></span><span style="font-family: 宋体;">安装</span>gcc<span style="font-family: 宋体;">?/span>g++<span style="font-family: 宋体;">?/span>make<span style="font-family: 宋体;">{?/span></p> <p style="margin-left: 18pt; text-indent: 0cm;"><span style="font-family: "Times New Roman","serif";">sudo apt-get install build-essential</span></p> <p style="margin-left: 18pt; text-indent: -18pt;"><span><span>4.<span style="font: 7pt "Times New Roman";">       </span></span></span><span style="font-family: 宋体;">安装</span>XRender</p> <p style="margin-left: 18pt; text-indent: 0cm;">sudo apt-get install libxrender-dev</p> <p style="margin-left: 18pt; text-indent: 0cm;">sudo apt-get install xorg-dev</p> <p style="margin-left: 18pt; text-indent: -18pt;"><span><span>5.<span style="font: 7pt "Times New Roman";">       </span></span></span><span style="font-family: 宋体;">安装</span>alsa</p> <p style="margin-left: 18pt; text-indent: 0cm;">sudo apt-get install libasound2-dev</p> <p style="margin-left: 18pt; text-indent: -18pt;"><span><span>6.<span style="font: 7pt "Times New Roman";">       </span></span></span>Cups</p> <p style="margin-left: 18pt; text-indent: 0cm;">sudo apt-get install libcups2-dev</p> <p style="margin-left: 18pt; text-indent: -18pt;"><span><span>7.<span style="font: 7pt "Times New Roman";">       </span></span></span><span style="font-family: 宋体;">安装</span>jdk6</p> <p style="margin-left: 18pt; text-indent: -18pt;"><span><span>8.<span style="font: 7pt "Times New Roman";">       </span></span></span><span style="font-family: 宋体;">安装</span>ant</p> <p style="margin-left: 18pt; text-indent: 0cm;"><span style="font-family: 宋体;">讄</span>ANT_HOME</p> <p style="margin-left: 18pt; text-indent: -18pt;"><span><span>9.<span style="font: 7pt "Times New Roman";">       </span></span></span><span style="font-family: 宋体;">安装</span>findbugs</p> <p style="margin-left: 18pt; text-indent: 0cm;"><span style="font-family: 宋体;">~译需要这玩意儿有点奇怪。需要设|?/span>FINDBUGS_HOME</p> <p style="margin-left: 18pt; text-indent: -18pt;"><span><span>10.<span style="font: 7pt "Times New Roman";">   </span></span></span><span style="font-family: 宋体;">试~译</span></p> <p style="margin-left: 18pt; text-indent: 0cm;">export LANG=C ALT_BOOTDIR=/opt/jdk1.6.0_22/</p> <p style="margin-left: 18pt; text-indent: 0cm;">#<span style="font-family: 宋体;">删除</span>JAVA_HOME</p> <p style="margin-left: 18pt; text-indent: 0cm;">export -n JAVA_HOME</p> <p style="margin-left: 18pt; text-indent: 0cm;">export ALT_JDK_IMPORT_PATH=/opt/jdk1.6.0_22/</p> <p style="margin-left: 18pt; text-indent: 0cm;">make sanity BUILD_JAXWS=false BUILD_JAXP =false</p> <p style="margin-left: 18pt; text-indent: 0cm;"><span style="font-family: 宋体;">?/span>build BUILD_JAXWS<span style="font-family: 宋体;">?/span>BUILD_JAXP<span style="font-family: 宋体;">L提示找不到源文gQ而我又暂时对只对</span>JDK<span style="font-family: 宋体;">?/span>Hotspot<span style="font-family: 宋体;">感兴,所以烦性把q两个给L?/span></p> <p style="margin-left: 18pt; text-indent: 0cm;"><span style="font-family: 宋体;">如果出现</span>:Sanity check passed.<span style="font-family: 宋体;">则表C测试编译通过了,不过也别开心得太早Q真?/span>make<span style="font-family: 宋体;">的时候不保证一定没问题Q也许还会缺某些依赖?/span></p> <p style="margin-left: 18pt; text-indent: -18pt;"><span><span>11.<span style="font: 7pt "Times New Roman";">   </span></span></span><span style="font-family: 宋体;">~译</span></p> <p style="text-indent: 18pt;"><span>export LANG=C ALT_BOOTDIR=/opt/jdk1.6.0_22/</span></p> <p style="margin-left: 18pt; text-indent: 0cm;">#<span style="font-family: 宋体;">删除</span>JAVA_HOME</p> <p style="text-indent: 18pt;"><span>export -n JAVA_HOME</span></p> <p style="text-indent: 18pt;"><span>export ALT_JDK_IMPORT_PATH=/opt/jdk1.6.0_22/</span></p> <p style="text-indent: 18pt;"><span>#make BUILD_JAXWS=false BUILD_JAXP=false</span></p> <p style="text-indent: 18pt;"><span>#make DEBUG_NAME=fastdebug BUILD_JAXWS=false BUILD_JAXP=false</span></p> <p style="margin-left: 18pt; text-indent: 0cm;"><span>make DEBUG_NAME=all_fastdebug BUILD_JAXWS=false BUILD_JAXP=false</span></p> <p style="margin-left: 18pt; text-indent: 0cm;"><span style="font-family: 宋体;">如果一切正常的话在</span>$HOME/jdk7/build/linux-i586/<span style="font-family: 宋体;">下就?/span>build<span style="font-family: 宋体;">出来?/span>jdk<span style="font-family: 宋体;">{了?/span></p> <img src ="http://www.tkk7.com/happyenjoylife/aggbug/342218.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/happyenjoylife/" target="_blank">happyenjoylife</a> 2011-01-03 19:46 <a href="http://www.tkk7.com/happyenjoylife/archive/2011/01/03/342218.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <p>лǵվܻԴȤ</p> <a href="http://www.tkk7.com/" title="亚洲av成人片在线观看">亚洲av成人片在线观看</a> <div class="friend-links"> </div> </div> </footer> վ֩ģ壺 <a href="http://wwwnewhtbook.com" target="_blank">һëƬëƬһëƬ</a>| <a href="http://hairdehf.com" target="_blank">һɫƬ</a>| <a href="http://bovch.com" target="_blank">AVר</a>| <a href="http://asdfghjklzxcv.com" target="_blank">ƷƵվ</a>| <a href="http://js-jiarui.com" target="_blank">ƷСƵapp </a>| <a href="http://8v4y.com" target="_blank">Ļĸ</a>| <a href="http://zjdoukai.com" target="_blank">޾ƷAV߲</a>| <a href="http://hezuoedu.com" target="_blank">ҰƵ</a>| <a href="http://jinluffcl.com" target="_blank">˳վɫ7799</a>| <a href="http://hljjlhl.com" target="_blank">ŮƷþþ2020</a>| <a href="http://szclinic.com" target="_blank">Ůվ</a>| <a href="http://k67m.com" target="_blank">ۺһƷ</a>| <a href="http://wwwjjz.com" target="_blank">Ӱѿ</a>| <a href="http://345504.com" target="_blank">þþþþùƷͬ </a>| <a href="http://f2dai.com" target="_blank">Ļ</a>| <a href="http://19520888.com" target="_blank">Ƶ</a>| <a href="http://tccqdy.com" target="_blank">Ƶ</a>| <a href="http://tzntrip.com" target="_blank"></a>| <a href="http://taoduoduo666.com" target="_blank">޾Ʒþþþþ</a>| <a href="http://91se01.com" target="_blank">Ƶ</a>| <a href="http://343dd.com" target="_blank">ձ岻aվ</a>| <a href="http://xxx2222.com" target="_blank">ҸŮˬ߳Ƭ</a>| <a href="http://c2277.com" target="_blank">ȫƵѸ</a>| <a href="http://by11gun.com" target="_blank">ƵַѲ</a>| <a href="http://huahui1866.com" target="_blank">˳վ߹ۿ</a>| <a href="http://ynxxrh.com" target="_blank">AVҹƷһ </a>| <a href="http://www99383.com" target="_blank">Ұ߹ۿ</a>| <a href="http://bjgelinhotel.com" target="_blank">޺ݺݾþۺһ77777</a>| <a href="http://yuntuzy.com" target="_blank">AƬѹۿ</a>| <a href="http://928288.com" target="_blank">aŹavۺav</a>| <a href="http://b2bautoparts.com" target="_blank">޽վƵ</a>| <a href="http://wwwks2424.com" target="_blank">ҹƵ</a>| <a href="http://0359jgyy.com" target="_blank">Ļ߹ۿ</a>| <a href="http://lfpfjc.com" target="_blank">99ƷƵ߹ۿѲ</a>| <a href="http://ziniurj.com" target="_blank">þպƷһ </a>| <a href="http://szmazida.com" target="_blank">˾þƵ</a>| <a href="http://5shitou.com" target="_blank">ҳվѹۿ</a>| <a href="http://by3142.com" target="_blank">ŷ㽶ۺ</a>| <a href="http://xsjxp.com" target="_blank">޹Ʒþþѿ</a>| <a href="http://tv886.com" target="_blank">99þ޾ƷѶ</a>| <a href="http://gs168sz.com" target="_blank">Ƶվѹۿ</a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>