本文整理汇总了Java中org.apache.thrift.async.AsyncMethodCallback类的典型用法代码示例。如果您正苦于以下问题:Java AsyncMethodCallback类的具体用法?Java AsyncMethodCallback怎么用?Java AsyncMethodCallback使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AsyncMethodCallback类属于org.apache.thrift.async包,在下文中一共展示了AsyncMethodCallback类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: push
import org.apache.thrift.async.AsyncMethodCallback; //导入依赖的package包/类
@Test
public void push() throws Exception {
doAnswer(invocation -> {
final AsyncMethodCallback<TCommit> callback = invocation.getArgument(7);
callback.onComplete(new TCommit(
new TRevision(1),
new TAuthor("name", "[email protected]"),
TIMESTAMP,
"summary",
new Comment("detail"),
ImmutableList.of()));
return null;
}).when(iface).push(anyString(), anyString(), any(), any(), any(), any(), any(), any());
assertThat(client.push("project", "repo", new Revision(1),
new Author("name", "[email protected]"),
"summary", "detail", Markup.PLAINTEXT,
ImmutableList.of(Change.ofTextUpsert("/a.txt", "hello"))
).get()).isEqualTo(new Commit(
new Revision(1),
new Author("name", "[email protected]"),
Instant.parse(TIMESTAMP).toEpochMilli(),
"summary", "detail", Markup.PLAINTEXT
));
verify(iface).push(eq("project"), eq("repo"), any(), any(), eq("summary"),
any(), any(), any());
}
示例2: deleteAllTs_call
import org.apache.thrift.async.AsyncMethodCallback; //导入依赖的package包/类
public deleteAllTs_call(ByteBuffer tableName, ByteBuffer row, ByteBuffer column, long timestamp, Map<ByteBuffer,ByteBuffer> attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.tableName = tableName;
this.row = row;
this.column = column;
this.timestamp = timestamp;
this.attributes = attributes;
}
示例3: unremoveProject
import org.apache.thrift.async.AsyncMethodCallback; //导入依赖的package包/类
@Test
public void unremoveProject() throws Exception {
doAnswer(invocation -> {
final AsyncMethodCallback<Void> callback = invocation.getArgument(1);
callback.onComplete(null);
return null;
}).when(iface).unremoveProject(any(), any());
assertThat(client.unremoveProject("project").get()).isNull();
verify(iface).unremoveProject(eq("project"), any());
}
示例4: unremoveRepository
import org.apache.thrift.async.AsyncMethodCallback; //导入依赖的package包/类
@Test
public void unremoveRepository() throws Exception {
doAnswer(invocation -> {
final AsyncMethodCallback<Void> callback = invocation.getArgument(2);
callback.onComplete(null);
return null;
}).when(iface).unremoveRepository(anyString(), anyString(), any());
assertThat(client.unremoveRepository("project", "repo").get()).isNull();
verify(iface).unremoveRepository(eq("project"), eq("repo"), any());
}
示例5: listRemovedRepositories
import org.apache.thrift.async.AsyncMethodCallback; //导入依赖的package包/类
@Test
public void listRemovedRepositories() throws Exception {
doAnswer(invocation -> {
final AsyncMethodCallback<Set<String>> callback = invocation.getArgument(1);
callback.onComplete(ImmutableSet.of("repo"));
return null;
}).when(iface).listRemovedRepositories(any(), any());
assertThat(client.listRemovedRepositories("project").get()).isEqualTo(ImmutableSet.of("repo"));
verify(iface).listRemovedRepositories(anyString(), any());
}
示例6: getFiles
import org.apache.thrift.async.AsyncMethodCallback; //导入依赖的package包/类
@Test
public void getFiles() throws Exception {
doAnswer(invocation -> {
final AsyncMethodCallback<List<TEntry>> callback = invocation.getArgument(4);
final TEntry entry = new TEntry("/b.txt", TEntryType.TEXT);
entry.setContent("world");
callback.onComplete(ImmutableList.of(entry));
return null;
}).when(iface).getFiles(anyString(), anyString(), any(), anyString(), any());
assertThat(client.getFiles("project", "repo", new Revision(1), "path").get())
.isEqualTo(ImmutableMap.of("/b.txt", Entry.ofText("/b.txt", "world")));
verify(iface).getFiles(anyString(), anyString(), any(), anyString(), any());
}
示例7: listProjects
import org.apache.thrift.async.AsyncMethodCallback; //导入依赖的package包/类
@Override
public void listProjects(AsyncMethodCallback resultHandler) {
handle(() -> {
final Map<String, com.linecorp.centraldogma.server.internal.storage.project.Project> projects =
projectManager.list();
final List<Project> ret = new ArrayList<>(projects.size());
projects.forEach((key, value) -> ret.add(convert(key, value)));
return ret;
}, resultHandler);
}
示例8: mutateRow_call
import org.apache.thrift.async.AsyncMethodCallback; //导入依赖的package包/类
public mutateRow_call(ByteBuffer tableName, ByteBuffer row, List<Mutation> mutations, Map<ByteBuffer,ByteBuffer> attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.tableName = tableName;
this.row = row;
this.mutations = mutations;
this.attributes = attributes;
}
示例9: getRowsWithColumnsTs_call
import org.apache.thrift.async.AsyncMethodCallback; //导入依赖的package包/类
public getRowsWithColumnsTs_call(ByteBuffer tableName, List<ByteBuffer> rows, List<ByteBuffer> columns, long timestamp, Map<ByteBuffer,ByteBuffer> attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.tableName = tableName;
this.rows = rows;
this.columns = columns;
this.timestamp = timestamp;
this.attributes = attributes;
}
示例10: getVerTs_call
import org.apache.thrift.async.AsyncMethodCallback; //导入依赖的package包/类
public getVerTs_call(ByteBuffer tableName, ByteBuffer row, ByteBuffer column, long timestamp, int numVersions, Map<ByteBuffer,ByteBuffer> attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.tableName = tableName;
this.row = row;
this.column = column;
this.timestamp = timestamp;
this.numVersions = numVersions;
this.attributes = attributes;
}
示例11: test_call
import org.apache.thrift.async.AsyncMethodCallback; //导入依赖的package包/类
public test_call(String name, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.name = name;
}
示例12: scannerOpenWithPrefix
import org.apache.thrift.async.AsyncMethodCallback; //导入依赖的package包/类
public void scannerOpenWithPrefix(ByteBuffer tableName, ByteBuffer startAndPrefix, List<ByteBuffer> columns, Map<ByteBuffer,ByteBuffer> attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
scannerOpenWithPrefix_call method_call = new scannerOpenWithPrefix_call(tableName, startAndPrefix, columns, attributes, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
示例13: echo
import org.apache.thrift.async.AsyncMethodCallback; //导入依赖的package包/类
public void echo(String msg, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
echo_call method_call = new echo_call(msg, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
示例14: start
import org.apache.thrift.async.AsyncMethodCallback; //导入依赖的package包/类
public void start(I iface, scannerClose_args args, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws TException {
iface.scannerClose(args.id,resultHandler);
}
示例15: getRegionInfo
import org.apache.thrift.async.AsyncMethodCallback; //导入依赖的package包/类
public void getRegionInfo(ByteBuffer row, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
getRegionInfo_call method_call = new getRegionInfo_call(row, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}