Merge lp:~pbeaman/akiban-server/persistit-3.2.9-changes into lp:~akiban-technologies/akiban-server/trunk

Proposed by Peter Beaman
Status: Rejected
Rejected by: Nathan Williams
Proposed branch: lp:~pbeaman/akiban-server/persistit-3.2.9-changes
Merge into: lp:~akiban-technologies/akiban-server/trunk
Diff against target: 85 lines (+8/-10)
3 files modified
pom.xml (+1/-1)
src/main/java/com/akiban/server/AccumulatorAdapter.java (+4/-5)
src/main/java/com/akiban/server/store/PersistitStoreSchemaManager.java (+3/-4)
To merge this branch: bzr merge lp:~pbeaman/akiban-server/persistit-3.2.9-changes
Reviewer Review Type Date Requested Status
Akiban Technologies Pending
Review via email: mp+158223@code.launchpad.net

Description of the change

Minimal changes necessitated by Persistit Accumulator API changes proposed for Persistit 3.2.9. Note that the generic methods used by AccumulatorAdapter are deprecated in Persistit (and not removed specifically to avoid having to do more damage to the server code). Perhaps we should instead rethink the code structure, get rid of AccumulatorAdapter (or make one for each relevant subtype) and then get rid of the deprecated Persistit methods. Advice welcome.

To post a comment you must log in.
Revision history for this message
Nathan Williams (nwilliams) wrote :

I have the code working in my branch fixing the logic, so I'll go ahead and incorporate the version bump there since it's touching a number of the same places.

Rethinking of AccumulatorAdapter is welcome, but I'd prefer another branch to reduce noise.

Unmerged revisions

2618. By Peter Beaman

Changes to support modified Accumulator API in Persistit 3.2.9

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'pom.xml'
--- pom.xml 2013-04-05 15:56:11 +0000
+++ pom.xml 2013-04-10 21:15:25 +0000
@@ -100,7 +100,7 @@
100 <dependency>100 <dependency>
101 <groupId>com.akiban</groupId>101 <groupId>com.akiban</groupId>
102 <artifactId>akiban-persistit</artifactId>102 <artifactId>akiban-persistit</artifactId>
103 <version>3.2.8-SNAPSHOT</version>103 <version>3.2.9-SNAPSHOT</version>
104 </dependency>104 </dependency>
105 <dependency>105 <dependency>
106 <groupId>com.akiban</groupId>106 <groupId>com.akiban</groupId>
107107
=== modified file 'src/main/java/com/akiban/server/AccumulatorAdapter.java'
--- src/main/java/com/akiban/server/AccumulatorAdapter.java 2013-03-22 20:05:57 +0000
+++ src/main/java/com/akiban/server/AccumulatorAdapter.java 2013-04-10 21:15:25 +0000
@@ -32,13 +32,12 @@
32 throws PersistitInterruptedException32 throws PersistitInterruptedException
33 {33 {
34 Accumulator accumulator = getAccumulator(accumInfo, tree);34 Accumulator accumulator = getAccumulator(accumInfo, tree);
35 Transaction txn = getCurrentTrx(treeService);35 return accumulator.getSnapshotValue();
36 return accumulator.getSnapshotValue(txn);
37 }36 }
3837
39 public static long updateAndGet(AccumInfo accumInfo, Exchange exchange, long value) {38 public static long updateAndGet(AccumInfo accumInfo, Exchange exchange, long value) {
40 Accumulator accumulator = getAccumulator(accumInfo, exchange.getTree());39 Accumulator accumulator = getAccumulator(accumInfo, exchange.getTree());
41 return accumulator.update(value, exchange.getTransaction());40 return accumulator.update(value);
42 }41 }
43 42
44 public static long getLiveValue(AccumInfo accumInfo, TreeService treeService, Tree tree)43 public static long getLiveValue(AccumInfo accumInfo, TreeService treeService, Tree tree)
@@ -48,11 +47,11 @@
48 }47 }
4948
50 public long getSnapshot() throws PersistitInterruptedException {49 public long getSnapshot() throws PersistitInterruptedException {
51 return accumulator.getSnapshotValue(getCurrentTrx());50 return accumulator.getSnapshotValue();
52 }51 }
5352
54 public long updateAndGet(long value) {53 public long updateAndGet(long value) {
55 return accumulator.update(value, getCurrentTrx());54 return accumulator.update(value);
56 }55 }
5756
58 public long getLiveValue() {57 public long getLiveValue() {
5958
=== modified file 'src/main/java/com/akiban/server/store/PersistitStoreSchemaManager.java'
--- src/main/java/com/akiban/server/store/PersistitStoreSchemaManager.java 2013-03-22 20:05:57 +0000
+++ src/main/java/com/akiban/server/store/PersistitStoreSchemaManager.java 2013-04-10 21:15:25 +0000
@@ -239,7 +239,6 @@
239 private static final String DELAYED_TREE_KEY = "delayedTree";239 private static final String DELAYED_TREE_KEY = "delayedTree";
240240
241 private static final int SCHEMA_GEN_ACCUM_INDEX = 0;241 private static final int SCHEMA_GEN_ACCUM_INDEX = 0;
242 private static final Accumulator.Type SCHEMA_GEN_ACCUM_TYPE = Accumulator.Type.SEQ;
243242
244 // Changed from 1 to 2 due to incompatibility related to index row changes (see bug 985007)243 // Changed from 1 to 2 due to incompatibility related to index row changes (see bug 985007)
245 private static final int PROTOBUF_PSSM_VERSION = 2;244 private static final int PROTOBUF_PSSM_VERSION = 2;
@@ -1474,7 +1473,7 @@
1474 final String SCHEMA = "pssm";1473 final String SCHEMA = "pssm";
1475 Exchange ex = schemaTreeExchange(session, SCHEMA);1474 Exchange ex = schemaTreeExchange(session, SCHEMA);
1476 try {1475 try {
1477 return ex.getTree().getAccumulator(SCHEMA_GEN_ACCUM_TYPE, SCHEMA_GEN_ACCUM_INDEX);1476 return ex.getTree().getSeqAccumulator(SCHEMA_GEN_ACCUM_INDEX);
1478 } finally {1477 } finally {
1479 treeService.releaseExchange(session, ex);1478 treeService.releaseExchange(session, ex);
1480 }1479 }
@@ -1482,7 +1481,7 @@
14821481
1483 private long getGenerationSnapshot(Session session) {1482 private long getGenerationSnapshot(Session session) {
1484 try {1483 try {
1485 return getGenerationAccumulator(session).getSnapshotValue(treeService.getDb().getTransaction());1484 return getGenerationAccumulator(session).getSnapshotValue();
1486 } catch(PersistitException e) {1485 } catch(PersistitException e) {
1487 throw wrapPersistitException(session, e);1486 throw wrapPersistitException(session, e);
1488 }1487 }
@@ -1491,7 +1490,7 @@
1491 private long getNextGeneration(Session session) {1490 private long getNextGeneration(Session session) {
1492 final int ACCUM_UPDATE_VALUE = 1; // irrelevant for SEQ types1491 final int ACCUM_UPDATE_VALUE = 1; // irrelevant for SEQ types
1493 try {1492 try {
1494 return getGenerationAccumulator(session).update(ACCUM_UPDATE_VALUE, treeService.getDb().getTransaction());1493 return getGenerationAccumulator(session).update(ACCUM_UPDATE_VALUE);
1495 } catch(PersistitException e) {1494 } catch(PersistitException e) {
1496 throw wrapPersistitException(session, e);1495 throw wrapPersistitException(session, e);
1497 }1496 }

Subscribers

People subscribed via source and target branches