Guava FAQ
(1) For a fixed value range of properties, it should be defined as an enumeration type whenever possible;
(2) Iterable,collection,list,set,map are interfaces, and the relationships between them are:
List and set inherit collection,collection inherit iterable; Map belongs to a single faction, it is the topmost interface, its implementation is HASHMAP,LINKEDHASHMAP,TREEMAP, wherein the TREEMAP internal structure is a red-black tree, it stores the nodes are ordered;
Mysql
(1) MySQL single-process multi-threaded database; Orcale is multi-process;
(2) The alter operation will lock the table, causing the request to block the table;
(3) The storage engine can only be specified at the level of the table and cannot be specified at the level of the library;
(4) The MySQL field decimal (5,2) represents a total of 5 bits for the fractional and integer parts, and a decimal portion of two bits;
(5) The difference between a decimal and a float, double is that the decimal stores the precision number, which is suitable for storing money numbers, etc.;
(6) Char is fixed-length, regardless of the character, the field is 4 bytes; The varchar is long, it contains a byte to record the length of the character stored in the field, if the character length is greater than 255 with two bytes to record; therefore, "" empty string, char occupies 4 bytes, VarChar is 1 bytes, "AA" char is 4 bytes, varchar is 3 bytes, "ABCD" char is 4 bytes, varchar is 5 bytes;
(7) Text and blog are big characters, so the index can only be built prefix index;
Other
1. Always remember to judge the legitimacy of incoming parameters;
2. When judging two objects equal, try to use guava objects.equals ();
3. The sorting with top K, in addition to using the heap, priority queue, you can also use the Ordering.greatestof method in guava, using the following method:
ordering<map.entry<String,new ordering<map.entry<string,integer>> () { @ Override int Compare (map.entry<string,integer> left, map.entry<string,return Left.getvalue ()-right.getvalue (); } }; list<map.entry<String,integer>> topklist = Ordering.greatestof (Httpmap.entryset (), K);
Training Daily 3.14 (Mysql,guava, pangolin, etc.)