Skip to content

Commit

Permalink
bind functionality to specific protocol version
Browse files Browse the repository at this point in the history
  • Loading branch information
markodjurovic committed Oct 16, 2018
1 parent 4da9e84 commit 4f8d618
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -477,8 +477,7 @@ public long next() throws OSequenceLimitReachedException, ExecutionException, In
boolean shouldGoOverDistributted = shouldGoOverDistrtibute();
return next(shouldGoOverDistributted);
}

//TODO hide this for regular user

long next(boolean executeViaDistributed) throws OSequenceLimitReachedException, ODatabaseException {
long retVal;
if (executeViaDistributed) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public OSequence getSequence(String iName) {
@Override
public OSequence createSequence(String iName, SEQUENCE_TYPE sequenceType, OSequence.CreateParams params)
throws ExecutionException, InterruptedException {
boolean shouldGoOverDistributted = database.isDistributed() && (replicationProtocolVersion > 1);
boolean shouldGoOverDistributted = database.isDistributed() && (replicationProtocolVersion == 2);
return createSequence(iName, sequenceType, params, shouldGoOverDistributted);
}

Expand All @@ -82,7 +82,7 @@ OSequence createSequence(String iName, SEQUENCE_TYPE sequenceType, OSequence.Cre
@Override
@Deprecated
public void dropSequence(String iName) throws ODatabaseException {
boolean shouldGoOverDistributted = database.isDistributed() && (replicationProtocolVersion > 1);
boolean shouldGoOverDistributted = database.isDistributed() && (replicationProtocolVersion == 2);
dropSequence(iName, shouldGoOverDistributted);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public void test() throws Exception {
final long previous = OGlobalConfiguration.DISTRIBUTED_ATOMIC_LOCK_TIMEOUT.getValueAsLong();
try {
OGlobalConfiguration.DISTRIBUTED_ATOMIC_LOCK_TIMEOUT.setValue(0);
OGlobalConfiguration.DISTRIBUTED_REPLICATION_PROTOCOL_VERSION.setValue(2);
// OGlobalConfiguration.DISTRIBUTED_REPLICATION_PROTOCOL_VERSION.setValue(2);

init(2);
prepare(false);
Expand Down

0 comments on commit 4f8d618

Please sign in to comment.