Skip to content
This repository has been archived by the owner on Nov 17, 2024. It is now read-only.

Commit

Permalink
Merge pull request #32 from caskdata/feature/TEPHRA-49_max-versions
Browse files Browse the repository at this point in the history
TEPHRA-49 Use max versions on flush and compaction
  • Loading branch information
ghelmling committed Dec 18, 2014
2 parents 130c6b9 + d72d848 commit 4ad680c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ public void preGet(ObserverContext<RegionCoprocessorEnvironment> e, Get get, Lis
if (LOG.isTraceEnabled()) {
LOG.trace("Applying filter to GET for transaction " + tx.getWritePointer());
}
get.setMaxVersions(tx.excludesSize() + 1);
get.setMaxVersions();
get.setTimeRange(TxUtils.getOldestVisibleTimestamp(ttlByFamily, tx), TxUtils.getMaxVisibleTimestamp(tx));
Filter newFilter = Filters.combine(getTransactionFilter(tx, ScanType.USER_SCAN), get.getFilter());
get.setFilter(newFilter);
Expand All @@ -162,7 +162,7 @@ public RegionScanner preScannerOpen(ObserverContext<RegionCoprocessorEnvironment
if (LOG.isTraceEnabled()) {
LOG.trace("Applying filter to SCAN for transaction " + tx.getWritePointer());
}
scan.setMaxVersions(tx.excludesSize() + 1);
scan.setMaxVersions();
scan.setTimeRange(TxUtils.getOldestVisibleTimestamp(ttlByFamily, tx), TxUtils.getMaxVisibleTimestamp(tx));
Filter newFilter = Filters.combine(getTransactionFilter(tx, ScanType.USER_SCAN), scan.getFilter());
scan.setFilter(newFilter);
Expand Down Expand Up @@ -203,8 +203,8 @@ protected InternalScanner createStoreScanner(RegionCoprocessorEnvironment env, S
// construct a dummy transaction from the latest snapshot
Transaction dummyTx = TxUtils.createDummyTransaction(snapshot);
Scan scan = new Scan();
// does not current support max versions setting per family
scan.setMaxVersions(dummyTx.excludesSize() + 1);
// need to see all versions, since we filter out excludes and applications may rely on multiple versions
scan.setMaxVersions();
scan.setFilter(new IncludeInProgressFilter(dummyTx.getVisibilityUpperBound(),
snapshot.getInvalid(),
getTransactionFilter(dummyTx, type)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public void preGetOp(ObserverContext<RegionCoprocessorEnvironment> e, Get get, L
throws IOException {
Transaction tx = txCodec.getFromOperation(get);
if (tx != null) {
get.setMaxVersions(tx.excludesSize() + 1);
get.setMaxVersions();
get.setTimeRange(TxUtils.getOldestVisibleTimestamp(ttlByFamily, tx), TxUtils.getMaxVisibleTimestamp(tx));
Filter newFilter = Filters.combine(getTransactionFilter(tx, ScanType.USER_SCAN), get.getFilter());
get.setFilter(newFilter);
Expand All @@ -154,7 +154,7 @@ public RegionScanner preScannerOpen(ObserverContext<RegionCoprocessorEnvironment
throws IOException {
Transaction tx = txCodec.getFromOperation(scan);
if (tx != null) {
scan.setMaxVersions(tx.excludesSize() + 1);
scan.setMaxVersions();
scan.setTimeRange(TxUtils.getOldestVisibleTimestamp(ttlByFamily, tx), TxUtils.getMaxVisibleTimestamp(tx));
Filter newFilter = Filters.combine(getTransactionFilter(tx, ScanType.USER_SCAN), scan.getFilter());
scan.setFilter(newFilter);
Expand Down Expand Up @@ -195,8 +195,8 @@ protected InternalScanner createStoreScanner(RegionCoprocessorEnvironment env, S
// construct a dummy transaction from the latest snapshot
Transaction dummyTx = TxUtils.createDummyTransaction(snapshot);
Scan scan = new Scan();
// does not current support max versions setting per family
scan.setMaxVersions(dummyTx.excludesSize() + 1);
// need to see all versions, since we filter out excludes and applications may rely on multiple versions
scan.setMaxVersions();
scan.setFilter(
new IncludeInProgressFilter(dummyTx.getVisibilityUpperBound(),
snapshot.getInvalid(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public void preGetOp(ObserverContext<RegionCoprocessorEnvironment> e, Get get, L
throws IOException {
Transaction tx = txCodec.getFromOperation(get);
if (tx != null) {
get.setMaxVersions(tx.excludesSize() + 1);
get.setMaxVersions();
get.setTimeRange(TxUtils.getOldestVisibleTimestamp(ttlByFamily, tx), TxUtils.getMaxVisibleTimestamp(tx));
Filter newFilter = Filters.combine(getTransactionFilter(tx, ScanType.USER_SCAN), get.getFilter());
get.setFilter(newFilter);
Expand All @@ -154,7 +154,7 @@ public RegionScanner preScannerOpen(ObserverContext<RegionCoprocessorEnvironment
throws IOException {
Transaction tx = txCodec.getFromOperation(scan);
if (tx != null) {
scan.setMaxVersions(tx.excludesSize() + 1);
scan.setMaxVersions();
scan.setTimeRange(TxUtils.getOldestVisibleTimestamp(ttlByFamily, tx), TxUtils.getMaxVisibleTimestamp(tx));
Filter newFilter = Filters.combine(getTransactionFilter(tx, ScanType.USER_SCAN), scan.getFilter());
scan.setFilter(newFilter);
Expand Down Expand Up @@ -195,8 +195,8 @@ protected InternalScanner createStoreScanner(RegionCoprocessorEnvironment env, S
// construct a dummy transaction from the latest snapshot
Transaction dummyTx = TxUtils.createDummyTransaction(snapshot);
Scan scan = new Scan();
// does not current support max versions setting per family
scan.setMaxVersions(dummyTx.excludesSize() + 1);
// need to see all versions, since we filter out excludes and applications may rely on multiple versions
scan.setMaxVersions();
scan.setFilter(
new IncludeInProgressFilter(dummyTx.getVisibilityUpperBound(),
snapshot.getInvalid(),
Expand Down

0 comments on commit 4ad680c

Please sign in to comment.