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
1=== modified file 'pom.xml'
2--- pom.xml 2013-04-05 15:56:11 +0000
3+++ pom.xml 2013-04-10 21:15:25 +0000
4@@ -100,7 +100,7 @@
5 <dependency>
6 <groupId>com.akiban</groupId>
7 <artifactId>akiban-persistit</artifactId>
8- <version>3.2.8-SNAPSHOT</version>
9+ <version>3.2.9-SNAPSHOT</version>
10 </dependency>
11 <dependency>
12 <groupId>com.akiban</groupId>
13
14=== modified file 'src/main/java/com/akiban/server/AccumulatorAdapter.java'
15--- src/main/java/com/akiban/server/AccumulatorAdapter.java 2013-03-22 20:05:57 +0000
16+++ src/main/java/com/akiban/server/AccumulatorAdapter.java 2013-04-10 21:15:25 +0000
17@@ -32,13 +32,12 @@
18 throws PersistitInterruptedException
19 {
20 Accumulator accumulator = getAccumulator(accumInfo, tree);
21- Transaction txn = getCurrentTrx(treeService);
22- return accumulator.getSnapshotValue(txn);
23+ return accumulator.getSnapshotValue();
24 }
25
26 public static long updateAndGet(AccumInfo accumInfo, Exchange exchange, long value) {
27 Accumulator accumulator = getAccumulator(accumInfo, exchange.getTree());
28- return accumulator.update(value, exchange.getTransaction());
29+ return accumulator.update(value);
30 }
31
32 public static long getLiveValue(AccumInfo accumInfo, TreeService treeService, Tree tree)
33@@ -48,11 +47,11 @@
34 }
35
36 public long getSnapshot() throws PersistitInterruptedException {
37- return accumulator.getSnapshotValue(getCurrentTrx());
38+ return accumulator.getSnapshotValue();
39 }
40
41 public long updateAndGet(long value) {
42- return accumulator.update(value, getCurrentTrx());
43+ return accumulator.update(value);
44 }
45
46 public long getLiveValue() {
47
48=== modified file 'src/main/java/com/akiban/server/store/PersistitStoreSchemaManager.java'
49--- src/main/java/com/akiban/server/store/PersistitStoreSchemaManager.java 2013-03-22 20:05:57 +0000
50+++ src/main/java/com/akiban/server/store/PersistitStoreSchemaManager.java 2013-04-10 21:15:25 +0000
51@@ -239,7 +239,6 @@
52 private static final String DELAYED_TREE_KEY = "delayedTree";
53
54 private static final int SCHEMA_GEN_ACCUM_INDEX = 0;
55- private static final Accumulator.Type SCHEMA_GEN_ACCUM_TYPE = Accumulator.Type.SEQ;
56
57 // Changed from 1 to 2 due to incompatibility related to index row changes (see bug 985007)
58 private static final int PROTOBUF_PSSM_VERSION = 2;
59@@ -1474,7 +1473,7 @@
60 final String SCHEMA = "pssm";
61 Exchange ex = schemaTreeExchange(session, SCHEMA);
62 try {
63- return ex.getTree().getAccumulator(SCHEMA_GEN_ACCUM_TYPE, SCHEMA_GEN_ACCUM_INDEX);
64+ return ex.getTree().getSeqAccumulator(SCHEMA_GEN_ACCUM_INDEX);
65 } finally {
66 treeService.releaseExchange(session, ex);
67 }
68@@ -1482,7 +1481,7 @@
69
70 private long getGenerationSnapshot(Session session) {
71 try {
72- return getGenerationAccumulator(session).getSnapshotValue(treeService.getDb().getTransaction());
73+ return getGenerationAccumulator(session).getSnapshotValue();
74 } catch(PersistitException e) {
75 throw wrapPersistitException(session, e);
76 }
77@@ -1491,7 +1490,7 @@
78 private long getNextGeneration(Session session) {
79 final int ACCUM_UPDATE_VALUE = 1; // irrelevant for SEQ types
80 try {
81- return getGenerationAccumulator(session).update(ACCUM_UPDATE_VALUE, treeService.getDb().getTransaction());
82+ return getGenerationAccumulator(session).update(ACCUM_UPDATE_VALUE);
83 } catch(PersistitException e) {
84 throw wrapPersistitException(session, e);
85 }

Subscribers

People subscribed via source and target branches