MCPcopy Index your code
hub / github.com/OpenTSDB/asynchbase / execute

Method execute

test/Test.java:128–163  ·  view source on GitHub ↗
(final HBaseClient client, String[] args)

Source from the content-addressed store, hash-verified

126
127 private static final class get implements Cmd {
128 public void execute(final HBaseClient client, String[] args) throws Exception {
129 ensureArguments(args, 4, 64);
130 final GetRequest get = new GetRequest(args[2], args[3]);
131 if (args.length > 4) {
132 get.family(args[4]);
133 }
134 if (args.length > 5) {
135 if (args.length == 6) {
136 get.qualifier(args[5]);
137 } else {
138 final byte[][] qualifiers = new byte[args.length - 5][];
139 for (int i = 5; i < args.length; i++) {
140 qualifiers[i - 5] = args[i].getBytes();
141 }
142 get.qualifiers(qualifiers);
143 }
144 }
145 RowLock lock = null;
146 if (args[1].charAt(0) == 'l') { // locked version of the command
147 final RowLockRequest rlr = new RowLockRequest(args[2], args[3]);
148 lock = client.lockRow(rlr).joinUninterruptibly();
149 LOG.info("Acquired explicit row lock: " + lock);
150 }
151 args = null;
152 try {
153 final ArrayList<KeyValue> result = client.get(get).joinUninterruptibly();
154 LOG.info("Get result=" + result);
155 } catch (Exception e) {
156 LOG.error("Get failed", e);
157 } finally {
158 if (lock != null) {
159 client.unlockRow(lock).joinUninterruptibly();
160 LOG.info("Released explicit row lock: " + lock);
161 }
162 }
163 }
164 }
165
166 private static final class icv implements Cmd {

Callers

nothing calls this directly

Calls 7

familyMethod · 0.95
qualifierMethod · 0.95
qualifiersMethod · 0.95
ensureArgumentsMethod · 0.80
lockRowMethod · 0.80
unlockRowMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected