Skip to content

Instantly share code, notes, and snippets.

@weilliu
Created August 29, 2014 08:33
Show Gist options
  • Save weilliu/209df6ce34bbca890d3e to your computer and use it in GitHub Desktop.
Save weilliu/209df6ce34bbca890d3e to your computer and use it in GitHub Desktop.
1.4 future
while (dsIter.hasNext()) {
Entry<String,String> kv = dsIter.next();
schema.addProperty(Strings.V_KIDENT, kv.getKey());
schema.addProperty(Strings.V_KSEQ, ii);
String value = JsonHelper.gs.toJson(schema);
OperationFuture<Boolean> ft = sdkHandle.set(kv.getKey(), 0, value);
cmdList.add(ft);
ii++;
}
int n_exc = 0;
for (OperationFuture<Boolean> ft : cmdList ) {
CommandResult res = new CommandResult(1);
try {
ft.get();
res.setCode(ft.getStatus());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment