hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From git-site-r...@apache.org
Subject [05/51] [partial] hbase-site git commit: Published site at .
Date Tue, 31 Oct 2017 15:16:53 GMT
http://git-wip-us.apache.org/repos/asf/hbase-site/blob/35decbe4/testdevapidocs/src-html/org/apache/hadoop/hbase/regionserver/TestCompactingToCellFlatMapMemStore.html
----------------------------------------------------------------------
diff --git a/testdevapidocs/src-html/org/apache/hadoop/hbase/regionserver/TestCompactingToCellFlatMapMemStore.html
b/testdevapidocs/src-html/org/apache/hadoop/hbase/regionserver/TestCompactingToCellFlatMapMemStore.html
index d28cf30..c97c8f0 100644
--- a/testdevapidocs/src-html/org/apache/hadoop/hbase/regionserver/TestCompactingToCellFlatMapMemStore.html
+++ b/testdevapidocs/src-html/org/apache/hadoop/hbase/regionserver/TestCompactingToCellFlatMapMemStore.html
@@ -102,7 +102,7 @@
 <span class="sourceLineNo">094</span>    }<a name="line.94"></a>
 <span class="sourceLineNo">095</span><a name="line.95"></a>
 <span class="sourceLineNo">096</span>    // test 1 bucket<a name="line.96"></a>
-<span class="sourceLineNo">097</span>    long totalCellsLen = addRowsByKeys(memstore,
keys1);<a name="line.97"></a>
+<span class="sourceLineNo">097</span>    long totalCellsLen = addRowsByKeysDataSize(memstore,
keys1);<a name="line.97"></a>
 <span class="sourceLineNo">098</span>    long cellBeforeFlushSize = cellBeforeFlushSize();<a
name="line.98"></a>
 <span class="sourceLineNo">099</span>    long cellAfterFlushSize  = cellAfterFlushSize();<a
name="line.99"></a>
 <span class="sourceLineNo">100</span>    long totalHeapSize = MutableSegment.DEEP_OVERHEAD
+ 4 * cellBeforeFlushSize;<a name="line.100"></a>
@@ -148,7 +148,7 @@
 <span class="sourceLineNo">140</span>    String[] keys1 = { "A", "A", "B", "C"
};<a name="line.140"></a>
 <span class="sourceLineNo">141</span>    String[] keys2 = { "A", "B", "D" };<a
name="line.141"></a>
 <span class="sourceLineNo">142</span><a name="line.142"></a>
-<span class="sourceLineNo">143</span>    long totalCellsLen1 = addRowsByKeys(memstore,
keys1);     // INSERT 4<a name="line.143"></a>
+<span class="sourceLineNo">143</span>    long totalCellsLen1 = addRowsByKeysDataSize(memstore,
keys1);     // INSERT 4<a name="line.143"></a>
 <span class="sourceLineNo">144</span>    long cellBeforeFlushSize = cellBeforeFlushSize();<a
name="line.144"></a>
 <span class="sourceLineNo">145</span>    long cellAfterFlushSize = cellAfterFlushSize();<a
name="line.145"></a>
 <span class="sourceLineNo">146</span>    long totalHeapSize1 = MutableSegment.DEEP_OVERHEAD
+ 4 * cellBeforeFlushSize;<a name="line.146"></a>
@@ -172,7 +172,7 @@
 <span class="sourceLineNo">164</span>    assertEquals(totalCellsLen1, regionServicesForStores.getMemStoreSize());<a
name="line.164"></a>
 <span class="sourceLineNo">165</span>    assertEquals(totalHeapSize1, ((CompactingMemStore)
memstore).heapSize());<a name="line.165"></a>
 <span class="sourceLineNo">166</span><a name="line.166"></a>
-<span class="sourceLineNo">167</span>    long totalCellsLen2 = addRowsByKeys(memstore,
keys2);   // INSERT 3 (3+3=6)<a name="line.167"></a>
+<span class="sourceLineNo">167</span>    long totalCellsLen2 = addRowsByKeysDataSize(memstore,
keys2);   // INSERT 3 (3+3=6)<a name="line.167"></a>
 <span class="sourceLineNo">168</span>    long totalHeapSize2 = 3 * cellBeforeFlushSize;<a
name="line.168"></a>
 <span class="sourceLineNo">169</span>    assertEquals(totalCellsLen1 + totalCellsLen2,
regionServicesForStores.getMemStoreSize());<a name="line.169"></a>
 <span class="sourceLineNo">170</span>    assertEquals(totalHeapSize1 + totalHeapSize2,
((CompactingMemStore) memstore).heapSize());<a name="line.170"></a>
@@ -210,7 +210,7 @@
 <span class="sourceLineNo">202</span>    String[] keys2 = { "A", "B", "D" };<a
name="line.202"></a>
 <span class="sourceLineNo">203</span>    String[] keys3 = { "D", "B", "B" };<a
name="line.203"></a>
 <span class="sourceLineNo">204</span><a name="line.204"></a>
-<span class="sourceLineNo">205</span>    long totalCellsLen1 = addRowsByKeys(memstore,
keys1);<a name="line.205"></a>
+<span class="sourceLineNo">205</span>    long totalCellsLen1 = addRowsByKeysDataSize(memstore,
keys1);<a name="line.205"></a>
 <span class="sourceLineNo">206</span>    long cellBeforeFlushSize = cellBeforeFlushSize();<a
name="line.206"></a>
 <span class="sourceLineNo">207</span>    long cellAfterFlushSize = cellAfterFlushSize();<a
name="line.207"></a>
 <span class="sourceLineNo">208</span>    long totalHeapSize1 = MutableSegment.DEEP_OVERHEAD
+ 4 * cellBeforeFlushSize;<a name="line.208"></a>
@@ -231,7 +231,7 @@
 <span class="sourceLineNo">223</span>    assertEquals(totalCellsLen1, regionServicesForStores.getMemStoreSize());<a
name="line.223"></a>
 <span class="sourceLineNo">224</span>    assertEquals(totalHeapSize1, ((CompactingMemStore)
memstore).heapSize());<a name="line.224"></a>
 <span class="sourceLineNo">225</span><a name="line.225"></a>
-<span class="sourceLineNo">226</span>    long totalCellsLen2 = addRowsByKeys(memstore,
keys2);<a name="line.226"></a>
+<span class="sourceLineNo">226</span>    long totalCellsLen2 = addRowsByKeysDataSize(memstore,
keys2);<a name="line.226"></a>
 <span class="sourceLineNo">227</span>    long totalHeapSize2 = 3 * cellBeforeFlushSize;<a
name="line.227"></a>
 <span class="sourceLineNo">228</span><a name="line.228"></a>
 <span class="sourceLineNo">229</span>    assertEquals(totalCellsLen1 + totalCellsLen2,
regionServicesForStores.getMemStoreSize());<a name="line.229"></a>
@@ -245,7 +245,7 @@
 <span class="sourceLineNo">237</span>    assertEquals(totalCellsLen1 + totalCellsLen2,
regionServicesForStores.getMemStoreSize());<a name="line.237"></a>
 <span class="sourceLineNo">238</span>    assertEquals(totalHeapSize1 + totalHeapSize2,
((CompactingMemStore) memstore).heapSize());<a name="line.238"></a>
 <span class="sourceLineNo">239</span><a name="line.239"></a>
-<span class="sourceLineNo">240</span>    long totalCellsLen3 = addRowsByKeys(memstore,
keys3);<a name="line.240"></a>
+<span class="sourceLineNo">240</span>    long totalCellsLen3 = addRowsByKeysDataSize(memstore,
keys3);<a name="line.240"></a>
 <span class="sourceLineNo">241</span>    long totalHeapSize3 = 3 * cellBeforeFlushSize;<a
name="line.241"></a>
 <span class="sourceLineNo">242</span>    assertEquals(totalCellsLen1 + totalCellsLen2
+ totalCellsLen3,<a name="line.242"></a>
 <span class="sourceLineNo">243</span>        regionServicesForStores.getMemStoreSize());<a
name="line.243"></a>
@@ -302,7 +302,7 @@
 <span class="sourceLineNo">294</span>    memstore.getConfiguration().set(CompactingMemStore.COMPACTING_MEMSTORE_TYPE_KEY,<a
name="line.294"></a>
 <span class="sourceLineNo">295</span>        String.valueOf(compactionType));<a
name="line.295"></a>
 <span class="sourceLineNo">296</span>    ((CompactingMemStore)memstore).initiateType(compactionType);<a
name="line.296"></a>
-<span class="sourceLineNo">297</span>    addRowsByKeys(memstore, keys1);<a
name="line.297"></a>
+<span class="sourceLineNo">297</span>    addRowsByKeysDataSize(memstore, keys1);<a
name="line.297"></a>
 <span class="sourceLineNo">298</span><a name="line.298"></a>
 <span class="sourceLineNo">299</span>    ((CompactingMemStore) memstore).flushInMemory();
// push keys to pipeline should not compact<a name="line.299"></a>
 <span class="sourceLineNo">300</span><a name="line.300"></a>
@@ -311,7 +311,7 @@
 <span class="sourceLineNo">303</span>    }<a name="line.303"></a>
 <span class="sourceLineNo">304</span>    assertEquals(0, memstore.getSnapshot().getCellsCount());<a
name="line.304"></a>
 <span class="sourceLineNo">305</span><a name="line.305"></a>
-<span class="sourceLineNo">306</span>    addRowsByKeys(memstore, keys2); // also
should only flatten<a name="line.306"></a>
+<span class="sourceLineNo">306</span>    addRowsByKeysDataSize(memstore, keys2);
// also should only flatten<a name="line.306"></a>
 <span class="sourceLineNo">307</span><a name="line.307"></a>
 <span class="sourceLineNo">308</span>    int counter2 = 0;<a name="line.308"></a>
 <span class="sourceLineNo">309</span>    for ( Segment s : memstore.getSegments())
{<a name="line.309"></a>
@@ -330,7 +330,7 @@
 <span class="sourceLineNo">322</span>    }<a name="line.322"></a>
 <span class="sourceLineNo">323</span>    assertEquals(12, counter3);<a name="line.323"></a>
 <span class="sourceLineNo">324</span><a name="line.324"></a>
-<span class="sourceLineNo">325</span>    addRowsByKeys(memstore, keys3);<a
name="line.325"></a>
+<span class="sourceLineNo">325</span>    addRowsByKeysDataSize(memstore, keys3);<a
name="line.325"></a>
 <span class="sourceLineNo">326</span><a name="line.326"></a>
 <span class="sourceLineNo">327</span>    int counter4 = 0;<a name="line.327"></a>
 <span class="sourceLineNo">328</span>    for ( Segment s : memstore.getSegments())
{<a name="line.328"></a>
@@ -612,49 +612,104 @@
 <span class="sourceLineNo">604</span>  }<a name="line.604"></a>
 <span class="sourceLineNo">605</span><a name="line.605"></a>
 <span class="sourceLineNo">606</span><a name="line.606"></a>
-<span class="sourceLineNo">607</span>  private long addRowsByKeys(final AbstractMemStore
hmc, String[] keys) {<a name="line.607"></a>
-<span class="sourceLineNo">608</span>    byte[] fam = Bytes.toBytes("testfamily");<a
name="line.608"></a>
-<span class="sourceLineNo">609</span>    byte[] qf = Bytes.toBytes("testqualifier");<a
name="line.609"></a>
-<span class="sourceLineNo">610</span>    MemStoreSizing memstoreSizing = new
MemStoreSizing();<a name="line.610"></a>
-<span class="sourceLineNo">611</span>    for (int i = 0; i &lt; keys.length;
i++) {<a name="line.611"></a>
-<span class="sourceLineNo">612</span>      long timestamp = System.currentTimeMillis();<a
name="line.612"></a>
-<span class="sourceLineNo">613</span>      Threads.sleep(1); // to make sure
each kv gets a different ts<a name="line.613"></a>
-<span class="sourceLineNo">614</span>      byte[] row = Bytes.toBytes(keys[i]);<a
name="line.614"></a>
-<span class="sourceLineNo">615</span>      byte[] val = Bytes.toBytes(keys[i]
+ i);<a name="line.615"></a>
-<span class="sourceLineNo">616</span>      KeyValue kv = new KeyValue(row, fam,
qf, timestamp, val);<a name="line.616"></a>
-<span class="sourceLineNo">617</span>      hmc.add(kv, memstoreSizing);<a
name="line.617"></a>
-<span class="sourceLineNo">618</span>      LOG.debug("added kv: " + kv.getKeyString()
+ ", timestamp" + kv.getTimestamp());<a name="line.618"></a>
-<span class="sourceLineNo">619</span>    }<a name="line.619"></a>
-<span class="sourceLineNo">620</span>    regionServicesForStores.addMemStoreSize(memstoreSizing);<a
name="line.620"></a>
-<span class="sourceLineNo">621</span>    return memstoreSizing.getDataSize();<a
name="line.621"></a>
-<span class="sourceLineNo">622</span>  }<a name="line.622"></a>
-<span class="sourceLineNo">623</span><a name="line.623"></a>
-<span class="sourceLineNo">624</span>  private long cellBeforeFlushSize() {<a
name="line.624"></a>
-<span class="sourceLineNo">625</span>    // make one cell<a name="line.625"></a>
-<span class="sourceLineNo">626</span>    byte[] row = Bytes.toBytes("A");<a
name="line.626"></a>
-<span class="sourceLineNo">627</span>    byte[] val = Bytes.toBytes("A" + 0);<a
name="line.627"></a>
-<span class="sourceLineNo">628</span>    KeyValue kv =<a name="line.628"></a>
-<span class="sourceLineNo">629</span>        new KeyValue(row, Bytes.toBytes("testfamily"),
Bytes.toBytes("testqualifier"),<a name="line.629"></a>
-<span class="sourceLineNo">630</span>            System.currentTimeMillis(),
val);<a name="line.630"></a>
-<span class="sourceLineNo">631</span>    return ClassSize.align(<a name="line.631"></a>
-<span class="sourceLineNo">632</span>        ClassSize.CONCURRENT_SKIPLISTMAP_ENTRY
+ KeyValue.FIXED_OVERHEAD + KeyValueUtil.length(kv));<a name="line.632"></a>
-<span class="sourceLineNo">633</span>  }<a name="line.633"></a>
+<span class="sourceLineNo">607</span>  @Test<a name="line.607"></a>
+<span class="sourceLineNo">608</span>  public void testFlatteningToCellChunkMap()
throws IOException {<a name="line.608"></a>
+<span class="sourceLineNo">609</span><a name="line.609"></a>
+<span class="sourceLineNo">610</span>    // set memstore to flat into CellChunkMap<a
name="line.610"></a>
+<span class="sourceLineNo">611</span>    MemoryCompactionPolicy compactionType
= MemoryCompactionPolicy.BASIC;<a name="line.611"></a>
+<span class="sourceLineNo">612</span>    memstore.getConfiguration().set(CompactingMemStore.COMPACTING_MEMSTORE_TYPE_KEY,<a
name="line.612"></a>
+<span class="sourceLineNo">613</span>        String.valueOf(compactionType));<a
name="line.613"></a>
+<span class="sourceLineNo">614</span>    ((CompactingMemStore)memstore).initiateType(compactionType);<a
name="line.614"></a>
+<span class="sourceLineNo">615</span>    memstore.getConfiguration().set(CompactingMemStore.COMPACTING_MEMSTORE_INDEX_KEY,<a
name="line.615"></a>
+<span class="sourceLineNo">616</span>        String.valueOf(CompactingMemStore.IndexType.CHUNK_MAP));<a
name="line.616"></a>
+<span class="sourceLineNo">617</span>    ((CompactingMemStore)memstore).setIndexType();<a
name="line.617"></a>
+<span class="sourceLineNo">618</span>    int numOfCells = 8;<a name="line.618"></a>
+<span class="sourceLineNo">619</span>    String[] keys1 = { "A", "A", "B", "C",
"D", "D", "E", "F" }; //A1, A2, B3, C4, D5, D6, E7, F8<a name="line.619"></a>
+<span class="sourceLineNo">620</span><a name="line.620"></a>
+<span class="sourceLineNo">621</span>    // make one cell<a name="line.621"></a>
+<span class="sourceLineNo">622</span>    byte[] row = Bytes.toBytes(keys1[0]);<a
name="line.622"></a>
+<span class="sourceLineNo">623</span>    byte[] val = Bytes.toBytes(keys1[0]
+ 0);<a name="line.623"></a>
+<span class="sourceLineNo">624</span>    KeyValue kv =<a name="line.624"></a>
+<span class="sourceLineNo">625</span>        new KeyValue(row, Bytes.toBytes("testfamily"),
Bytes.toBytes("testqualifier"),<a name="line.625"></a>
+<span class="sourceLineNo">626</span>            System.currentTimeMillis(),
val);<a name="line.626"></a>
+<span class="sourceLineNo">627</span><a name="line.627"></a>
+<span class="sourceLineNo">628</span>    // test 1 bucket<a name="line.628"></a>
+<span class="sourceLineNo">629</span>    int totalCellsLen = addRowsByKeys(memstore,
keys1);<a name="line.629"></a>
+<span class="sourceLineNo">630</span>    long oneCellOnCSLMHeapSize =<a name="line.630"></a>
+<span class="sourceLineNo">631</span>        ClassSize.align(<a name="line.631"></a>
+<span class="sourceLineNo">632</span>            ClassSize.CONCURRENT_SKIPLISTMAP_ENTRY
+ KeyValue.FIXED_OVERHEAD + KeyValueUtil<a name="line.632"></a>
+<span class="sourceLineNo">633</span>                .length(kv));<a name="line.633"></a>
 <span class="sourceLineNo">634</span><a name="line.634"></a>
-<span class="sourceLineNo">635</span>  private long cellAfterFlushSize() {<a
name="line.635"></a>
-<span class="sourceLineNo">636</span>    // make one cell<a name="line.636"></a>
-<span class="sourceLineNo">637</span>    byte[] row = Bytes.toBytes("A");<a
name="line.637"></a>
-<span class="sourceLineNo">638</span>    byte[] val = Bytes.toBytes("A" + 0);<a
name="line.638"></a>
-<span class="sourceLineNo">639</span>    KeyValue kv =<a name="line.639"></a>
-<span class="sourceLineNo">640</span>        new KeyValue(row, Bytes.toBytes("testfamily"),
Bytes.toBytes("testqualifier"),<a name="line.640"></a>
-<span class="sourceLineNo">641</span>            System.currentTimeMillis(),
val);<a name="line.641"></a>
-<span class="sourceLineNo">642</span><a name="line.642"></a>
-<span class="sourceLineNo">643</span>    return toCellChunkMap ?<a name="line.643"></a>
-<span class="sourceLineNo">644</span>        ClassSize.align(<a name="line.644"></a>
-<span class="sourceLineNo">645</span>        ClassSize.CELL_CHUNK_MAP_ENTRY +
KeyValueUtil.length(kv)) :<a name="line.645"></a>
-<span class="sourceLineNo">646</span>        ClassSize.align(<a name="line.646"></a>
-<span class="sourceLineNo">647</span>        ClassSize.CELL_ARRAY_MAP_ENTRY +
KeyValue.FIXED_OVERHEAD + KeyValueUtil.length(kv));<a name="line.647"></a>
-<span class="sourceLineNo">648</span>  }<a name="line.648"></a>
-<span class="sourceLineNo">649</span>}<a name="line.649"></a>
+<span class="sourceLineNo">635</span>    long totalHeapSize = numOfCells * oneCellOnCSLMHeapSize
+ MutableSegment.DEEP_OVERHEAD;<a name="line.635"></a>
+<span class="sourceLineNo">636</span>    assertEquals(totalCellsLen, regionServicesForStores.getMemStoreSize());<a
name="line.636"></a>
+<span class="sourceLineNo">637</span>    assertEquals(totalHeapSize, ((CompactingMemStore)
memstore).heapSize());<a name="line.637"></a>
+<span class="sourceLineNo">638</span><a name="line.638"></a>
+<span class="sourceLineNo">639</span>    ((CompactingMemStore)memstore).flushInMemory();
// push keys to pipeline and flatten<a name="line.639"></a>
+<span class="sourceLineNo">640</span>    assertEquals(0, memstore.getSnapshot().getCellsCount());<a
name="line.640"></a>
+<span class="sourceLineNo">641</span>    // One cell is duplicated, but it shouldn't
be compacted because we are in BASIC mode.<a name="line.641"></a>
+<span class="sourceLineNo">642</span>    // totalCellsLen should remain the same<a
name="line.642"></a>
+<span class="sourceLineNo">643</span>    long oneCellOnCCMHeapSize =<a name="line.643"></a>
+<span class="sourceLineNo">644</span>        ClassSize.CELL_CHUNK_MAP_ENTRY +
ClassSize.align(KeyValueUtil.length(kv));<a name="line.644"></a>
+<span class="sourceLineNo">645</span>    totalHeapSize = MutableSegment.DEEP_OVERHEAD
+ CellChunkImmutableSegment.DEEP_OVERHEAD_CCM<a name="line.645"></a>
+<span class="sourceLineNo">646</span>        + numOfCells * oneCellOnCCMHeapSize;<a
name="line.646"></a>
+<span class="sourceLineNo">647</span><a name="line.647"></a>
+<span class="sourceLineNo">648</span>    assertEquals(totalCellsLen, regionServicesForStores.getMemStoreSize());<a
name="line.648"></a>
+<span class="sourceLineNo">649</span>    assertEquals(totalHeapSize, ((CompactingMemStore)
memstore).heapSize());<a name="line.649"></a>
+<span class="sourceLineNo">650</span><a name="line.650"></a>
+<span class="sourceLineNo">651</span>    MemStoreSize size = memstore.getFlushableSize();<a
name="line.651"></a>
+<span class="sourceLineNo">652</span>    MemStoreSnapshot snapshot = memstore.snapshot();
// push keys to snapshot<a name="line.652"></a>
+<span class="sourceLineNo">653</span>    region.decrMemStoreSize(size);  // simulate
flusher<a name="line.653"></a>
+<span class="sourceLineNo">654</span>    ImmutableSegment s = memstore.getSnapshot();<a
name="line.654"></a>
+<span class="sourceLineNo">655</span>    assertEquals(numOfCells, s.getCellsCount());<a
name="line.655"></a>
+<span class="sourceLineNo">656</span>    assertEquals(0, regionServicesForStores.getMemStoreSize());<a
name="line.656"></a>
+<span class="sourceLineNo">657</span><a name="line.657"></a>
+<span class="sourceLineNo">658</span>    memstore.clearSnapshot(snapshot.getId());<a
name="line.658"></a>
+<span class="sourceLineNo">659</span>  }<a name="line.659"></a>
+<span class="sourceLineNo">660</span><a name="line.660"></a>
+<span class="sourceLineNo">661</span><a name="line.661"></a>
+<span class="sourceLineNo">662</span>  private long addRowsByKeysDataSize(final
AbstractMemStore hmc, String[] keys) {<a name="line.662"></a>
+<span class="sourceLineNo">663</span>    byte[] fam = Bytes.toBytes("testfamily");<a
name="line.663"></a>
+<span class="sourceLineNo">664</span>    byte[] qf = Bytes.toBytes("testqualifier");<a
name="line.664"></a>
+<span class="sourceLineNo">665</span>    MemStoreSizing memstoreSizing = new
MemStoreSizing();<a name="line.665"></a>
+<span class="sourceLineNo">666</span>    for (int i = 0; i &lt; keys.length;
i++) {<a name="line.666"></a>
+<span class="sourceLineNo">667</span>      long timestamp = System.currentTimeMillis();<a
name="line.667"></a>
+<span class="sourceLineNo">668</span>      Threads.sleep(1); // to make sure
each kv gets a different ts<a name="line.668"></a>
+<span class="sourceLineNo">669</span>      byte[] row = Bytes.toBytes(keys[i]);<a
name="line.669"></a>
+<span class="sourceLineNo">670</span>      byte[] val = Bytes.toBytes(keys[i]
+ i);<a name="line.670"></a>
+<span class="sourceLineNo">671</span>      KeyValue kv = new KeyValue(row, fam,
qf, timestamp, val);<a name="line.671"></a>
+<span class="sourceLineNo">672</span>      hmc.add(kv, memstoreSizing);<a
name="line.672"></a>
+<span class="sourceLineNo">673</span>      LOG.debug("added kv: " + kv.getKeyString()
+ ", timestamp" + kv.getTimestamp());<a name="line.673"></a>
+<span class="sourceLineNo">674</span>    }<a name="line.674"></a>
+<span class="sourceLineNo">675</span>    regionServicesForStores.addMemStoreSize(memstoreSizing);<a
name="line.675"></a>
+<span class="sourceLineNo">676</span>    return memstoreSizing.getDataSize();<a
name="line.676"></a>
+<span class="sourceLineNo">677</span>  }<a name="line.677"></a>
+<span class="sourceLineNo">678</span><a name="line.678"></a>
+<span class="sourceLineNo">679</span>  private long cellBeforeFlushSize() {<a
name="line.679"></a>
+<span class="sourceLineNo">680</span>    // make one cell<a name="line.680"></a>
+<span class="sourceLineNo">681</span>    byte[] row = Bytes.toBytes("A");<a
name="line.681"></a>
+<span class="sourceLineNo">682</span>    byte[] val = Bytes.toBytes("A" + 0);<a
name="line.682"></a>
+<span class="sourceLineNo">683</span>    KeyValue kv =<a name="line.683"></a>
+<span class="sourceLineNo">684</span>        new KeyValue(row, Bytes.toBytes("testfamily"),
Bytes.toBytes("testqualifier"),<a name="line.684"></a>
+<span class="sourceLineNo">685</span>            System.currentTimeMillis(),
val);<a name="line.685"></a>
+<span class="sourceLineNo">686</span>    return ClassSize.align(<a name="line.686"></a>
+<span class="sourceLineNo">687</span>        ClassSize.CONCURRENT_SKIPLISTMAP_ENTRY
+ KeyValue.FIXED_OVERHEAD + KeyValueUtil.length(kv));<a name="line.687"></a>
+<span class="sourceLineNo">688</span>  }<a name="line.688"></a>
+<span class="sourceLineNo">689</span><a name="line.689"></a>
+<span class="sourceLineNo">690</span>  private long cellAfterFlushSize() {<a
name="line.690"></a>
+<span class="sourceLineNo">691</span>    // make one cell<a name="line.691"></a>
+<span class="sourceLineNo">692</span>    byte[] row = Bytes.toBytes("A");<a
name="line.692"></a>
+<span class="sourceLineNo">693</span>    byte[] val = Bytes.toBytes("A" + 0);<a
name="line.693"></a>
+<span class="sourceLineNo">694</span>    KeyValue kv =<a name="line.694"></a>
+<span class="sourceLineNo">695</span>        new KeyValue(row, Bytes.toBytes("testfamily"),
Bytes.toBytes("testqualifier"),<a name="line.695"></a>
+<span class="sourceLineNo">696</span>            System.currentTimeMillis(),
val);<a name="line.696"></a>
+<span class="sourceLineNo">697</span><a name="line.697"></a>
+<span class="sourceLineNo">698</span>    return toCellChunkMap ?<a name="line.698"></a>
+<span class="sourceLineNo">699</span>        ClassSize.align(<a name="line.699"></a>
+<span class="sourceLineNo">700</span>        ClassSize.CELL_CHUNK_MAP_ENTRY +
KeyValueUtil.length(kv)) :<a name="line.700"></a>
+<span class="sourceLineNo">701</span>        ClassSize.align(<a name="line.701"></a>
+<span class="sourceLineNo">702</span>        ClassSize.CELL_ARRAY_MAP_ENTRY +
KeyValue.FIXED_OVERHEAD + KeyValueUtil.length(kv));<a name="line.702"></a>
+<span class="sourceLineNo">703</span>  }<a name="line.703"></a>
+<span class="sourceLineNo">704</span>}<a name="line.704"></a>
 
 
 


Mime
View raw message