Permalink
Browse files

minfor refactoring

  • Loading branch information...
1 parent 6d59b1d commit 728da4f527a4e73e41c8285bd6e9338365b29348 Maysam Yabandeh committed May 25, 2012
@@ -18,8 +18,9 @@
import com.yahoo.omid.client.TSOClient.Result;
import com.yahoo.omid.tso.RowKey;
+import java.util.ArrayList;
public interface CommitCallback extends Callback {
- public void complete(Result res, long commitTimestamp, RowKey[] wwRows);
+ public void complete(Result res, long commitTimestamp, ArrayList<RowKey> rowsWithWriteWriteConflict);
}
@@ -61,30 +61,30 @@ private void init() {
}
@Override
- public ReturnCode filterKeyValue(KeyValue v) {
- long version = v.getTimestamp();
- if (version >= endTime)
- return ReturnCode.SKIP;
- if (includedVersions < minVersions || version > startTime) {
- includedVersions++;
- return ReturnCode.INCLUDE;
- }
- return ReturnCode.NEXT_COL;
+ public ReturnCode filterKeyValue(KeyValue v) {
+ long version = v.getTimestamp();
+ if (version >= endTime)
+ return ReturnCode.SKIP;
+ if (includedVersions < minVersions || version > startTime) {
+ includedVersions++;
+ return ReturnCode.INCLUDE;
}
+ return ReturnCode.NEXT_COL;
+ }
@Override
- public void readFields(DataInput in) throws IOException {
- this.startTime = in.readLong();
- this.endTime = in.readLong();
- this.minVersions = in.readInt();
- init();
- }
+ public void readFields(DataInput in) throws IOException {
+ this.startTime = in.readLong();
+ this.endTime = in.readLong();
+ this.minVersions = in.readInt();
+ init();
+ }
@Override
- public void write(DataOutput out) throws IOException {
- out.writeLong(this.startTime);
- out.writeLong(this.endTime);
- out.writeInt(this.minVersions);
- }
+ public void write(DataOutput out) throws IOException {
+ out.writeLong(this.startTime);
+ out.writeLong(this.endTime);
+ out.writeInt(this.minVersions);
+ }
}
@@ -18,11 +18,12 @@
import com.yahoo.omid.client.TSOClient.Result;
import com.yahoo.omid.tso.RowKey;
+import java.util.ArrayList;
public class SyncCommitCallback extends SyncCallbackBase implements CommitCallback {
private Result result;
private long commitTimestamp;
- private RowKey[] wwRows;//rows with write-write conflict
+ private ArrayList<RowKey> rowsWithWriteWriteConflict;//rows with write-write conflict
public Result getResult() {
return result;
@@ -33,17 +34,17 @@ public long getCommitTimestamp() {
}
public boolean isElder() {
- return wwRows != null && wwRows.length != 0;
+ return rowsWithWriteWriteConflict != null && rowsWithWriteWriteConflict.size() != 0;
}
- public RowKey[] getWWRows() {
- return wwRows;
+ public ArrayList<RowKey> getWWRows() {
+ return rowsWithWriteWriteConflict;
}
- synchronized public void complete(Result res, long commitTimestamp, RowKey[] wwRows) {
+ synchronized public void complete(Result res, long commitTimestamp, ArrayList<RowKey> rowsWithWriteWriteConflict) {
this.result = res;
this.commitTimestamp = commitTimestamp;
- this.wwRows = wwRows;
+ this.rowsWithWriteWriteConflict = rowsWithWriteWriteConflict;
countDown();
}
}
Oops, something went wrong.

0 comments on commit 728da4f

Please sign in to comment.