long seqId = 100; myStore.add(createCell(qf1, ts, seqId, oldValue), memStoreSizing); myStore.add(createCell(qf2, ts, seqId, oldValue), memStoreSizing); myStore.add(createCell(qf3, ts, seqId, oldValue), memStoreSizing); long snapshotId = id++; myStore.add(createCell(qf1, ts + 1, seqId + 1, currentValue), memStoreSizing); myStore.add(createCell(qf2, ts + 1, seqId + 1, currentValue), memStoreSizing); myStore.add(createCell(qf3, ts + 1, seqId + 1, currentValue), memStoreSizing); TreeSet<byte[]> quals = new TreeSet<>(Bytes.BYTES_COMPARATOR); quals.add(qf1); quals.add(qf2); quals.add(qf3); try (InternalScanner scanner = (InternalScanner) myStore.getScanner( new Scan(new Get(row)), quals, seqId + 1)) {
store.add(createCell(Bytes.toBytes("row" + i), qf1, ts, seqID++, Bytes.toBytes("")), memStoreSizing); store.add(createCell(Bytes.toBytes("row" + i), qf1, ts, seqID++, Bytes.toBytes("")), memStoreSizing); store.add(createCell(Bytes.toBytes("row" + i), qf1, ts, seqID++, Bytes.toBytes("")), memStoreSizing); assertEquals(3, store.getStorefilesCount()); Scan scan = new Scan(); scan.addFamily(family); Collection<HStoreFile> storefiles2 = store.getStorefiles(); ArrayList<HStoreFile> actualStorefiles = Lists.newArrayList(storefiles2); StoreScanner storeScanner = (StoreScanner) store.getScanner(scan, scan.getFamilyMap().get(family), Long.MAX_VALUE); store.add(createCell(Bytes.toBytes("row" + i), qf1, ts, seqID++, Bytes.toBytes("")), memStoreSizing); store.add(createCell(Bytes.toBytes("row" + i), qf1, ts, seqID++, Bytes.toBytes("")), memStoreSizing); storefiles2 = store.getStorefiles(); ArrayList<HStoreFile> actualStorefiles1 = Lists.newArrayList(storefiles2); actualStorefiles1.removeAll(actualStorefiles); store.replaceStoreFiles(actualStorefiles, actualStorefiles1); thread.join();
long seqId = 100; myStore.add(createCell(qf1, ts, seqId, oldValue), memStoreSizing); myStore.add(createCell(qf2, ts, seqId, oldValue), memStoreSizing); myStore.add(createCell(qf3, ts, seqId, oldValue), memStoreSizing); long snapshotId = id++; myStore.add(createCell(qf1, ts + 1, seqId + 1, currentValue), memStoreSizing); myStore.add(createCell(qf2, ts + 1, seqId + 1, currentValue), memStoreSizing); myStore.add(createCell(qf3, ts + 1, seqId + 1, currentValue), memStoreSizing); TreeSet<byte[]> quals = new TreeSet<>(Bytes.BYTES_COMPARATOR); quals.add(qf1); quals.add(qf2); quals.add(qf3); try (InternalScanner scanner = (InternalScanner) myStore.getScanner( new Scan(new Get(row)), quals, seqId + 1)) {
store.add(createCell(Bytes.toBytes("row" + i), qf1, ts, seqID++, Bytes.toBytes("")), memStoreSizing); store.add(createCell(Bytes.toBytes("row" + i), qf1, ts, seqID++, Bytes.toBytes("")), memStoreSizing); store.add(createCell(Bytes.toBytes("row" + i), qf1, ts, seqID++, Bytes.toBytes("")), memStoreSizing); assertEquals(3, store.getStorefilesCount()); Scan scan = new Scan(); scan.addFamily(family); Collection<HStoreFile> storefiles2 = store.getStorefiles(); ArrayList<HStoreFile> actualStorefiles = Lists.newArrayList(storefiles2); StoreScanner storeScanner = (StoreScanner) store.getScanner(scan, scan.getFamilyMap().get(family), Long.MAX_VALUE); store.add(createCell(Bytes.toBytes("row" + i), qf1, ts, seqID++, Bytes.toBytes("")), memStoreSizing); store.add(createCell(Bytes.toBytes("row" + i), qf1, ts, seqID++, Bytes.toBytes("")), memStoreSizing); storefiles2 = store.getStorefiles(); ArrayList<HStoreFile> actualStorefiles1 = Lists.newArrayList(storefiles2); actualStorefiles1.removeAll(actualStorefiles); store.replaceStoreFiles(actualStorefiles, actualStorefiles1); thread.join();
private HStore init(String methodName, Configuration conf, TableDescriptorBuilder builder, ColumnFamilyDescriptor hcd, MyStoreHook hook, boolean switchToPread) throws IOException { initHRegion(methodName, conf, builder, hcd, hook, switchToPread); if (hook == null) { store = new HStore(region, hcd, conf); } else { store = new MyStore(region, hcd, conf, hook, switchToPread); } return store; }
private HStore init(String methodName, Configuration conf, TableDescriptorBuilder builder, ColumnFamilyDescriptor hcd, MyStoreHook hook, boolean switchToPread) throws IOException { initHRegion(methodName, conf, builder, hcd, hook, switchToPread); if (hook == null) { store = new HStore(region, hcd, conf); } else { store = new MyStore(region, hcd, conf, hook, switchToPread); } return store; }