1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.apache.omid.committable;
19
20 import org.apache.phoenix.thirdparty.com.google.common.base.Optional;
21 import org.apache.phoenix.thirdparty.com.google.common.util.concurrent.ListenableFuture;
22 import org.apache.phoenix.thirdparty.com.google.common.util.concurrent.SettableFuture;
23
24 import java.io.IOException;
25
26 public class NullCommitTable implements CommitTable {
27 @Override
28 public CommitTable.Writer getWriter() {
29 return new Writer();
30 }
31
32 @Override
33 public CommitTable.Client getClient() {
34 return new Client();
35 }
36
37 public static class Writer implements CommitTable.Writer {
38 @Override
39 public void addCommittedTransaction(long startTimestamp, long commitTimestamp) {
40
41 }
42
43 @Override
44 public void updateLowWatermark(long lowWatermark) throws IOException {
45
46 }
47
48 @Override
49 public void clearWriteBuffer() {
50
51 }
52
53 @Override
54 public boolean atomicAddCommittedTransaction(long startTimestamp, long commitTimestamp) throws IOException {
55 return true;
56 }
57
58 @Override
59 public void flush() throws IOException {
60
61 }
62 }
63
64 public static class Client implements CommitTable.Client {
65 @Override
66 public ListenableFuture<Optional<CommitTimestamp>> getCommitTimestamp(long startTimestamp) {
67 throw new UnsupportedOperationException();
68 }
69
70 @Override
71 public ListenableFuture<Long> readLowWatermark() {
72 throw new UnsupportedOperationException();
73 }
74
75 @Override
76 public ListenableFuture<Void> deleteCommitEntry(long startTimestamp) {
77 SettableFuture<Void> f = SettableFuture.create();
78 f.set(null);
79 return f;
80 }
81
82 @Override
83 public ListenableFuture<Boolean> tryInvalidateTransaction(long startTimestamp) {
84 throw new UnsupportedOperationException();
85 }
86
87 }
88 }