MCPcopy Create free account
hub / github.com/apache/storm / AsyncClient

Class AsyncClient

storm-client/src/jvm/org/apache/storm/generated/Nimbus.java:1852–3895  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1850
1851 }
1852 public static class AsyncClient extends org.apache.storm.thrift.async.TAsyncClient implements AsyncIface {
1853 public static class Factory implements org.apache.storm.thrift.async.TAsyncClientFactory<AsyncClient> {
1854 private org.apache.storm.thrift.async.TAsyncClientManager clientManager;
1855 private org.apache.storm.thrift.protocol.TProtocolFactory protocolFactory;
1856 public Factory(org.apache.storm.thrift.async.TAsyncClientManager clientManager, org.apache.storm.thrift.protocol.TProtocolFactory protocolFactory) {
1857 this.clientManager = clientManager;
1858 this.protocolFactory = protocolFactory;
1859 }
1860 @Override
1861 public AsyncClient getAsyncClient(org.apache.storm.thrift.transport.TNonblockingTransport transport) {
1862 return new AsyncClient(protocolFactory, clientManager, transport);
1863 }
1864 }
1865
1866 public AsyncClient(org.apache.storm.thrift.protocol.TProtocolFactory protocolFactory, org.apache.storm.thrift.async.TAsyncClientManager clientManager, org.apache.storm.thrift.transport.TNonblockingTransport transport) {
1867 super(protocolFactory, clientManager, transport);
1868 }
1869
1870 @Override
1871 public void submitTopology(java.lang.String name, java.lang.String uploadedJarLocation, java.lang.String jsonConf, StormTopology topology, org.apache.storm.thrift.async.AsyncMethodCallback<Void> resultHandler) throws org.apache.storm.thrift.TException {
1872 checkReady();
1873 submitTopology_call method_call = new submitTopology_call(name, uploadedJarLocation, jsonConf, topology, resultHandler, this, ___protocolFactory, ___transport);
1874 this.___currentMethod = method_call;
1875 ___manager.call(method_call);
1876 }
1877
1878 public static class submitTopology_call extends org.apache.storm.thrift.async.TAsyncMethodCall<Void> {
1879 private java.lang.String name;
1880 private java.lang.String uploadedJarLocation;
1881 private java.lang.String jsonConf;
1882 private StormTopology topology;
1883 public submitTopology_call(java.lang.String name, java.lang.String uploadedJarLocation, java.lang.String jsonConf, StormTopology topology, org.apache.storm.thrift.async.AsyncMethodCallback<Void> resultHandler, org.apache.storm.thrift.async.TAsyncClient client, org.apache.storm.thrift.protocol.TProtocolFactory protocolFactory, org.apache.storm.thrift.transport.TNonblockingTransport transport) throws org.apache.storm.thrift.TException {
1884 super(client, protocolFactory, transport, resultHandler, false);
1885 this.name = name;
1886 this.uploadedJarLocation = uploadedJarLocation;
1887 this.jsonConf = jsonConf;
1888 this.topology = topology;
1889 }
1890
1891 @Override
1892 public void write_args(org.apache.storm.thrift.protocol.TProtocol prot) throws org.apache.storm.thrift.TException {
1893 prot.writeMessageBegin(new org.apache.storm.thrift.protocol.TMessage("submitTopology", org.apache.storm.thrift.protocol.TMessageType.CALL, 0));
1894 submitTopology_args args = new submitTopology_args();
1895 args.set_name(name);
1896 args.set_uploadedJarLocation(uploadedJarLocation);
1897 args.set_jsonConf(jsonConf);
1898 args.set_topology(topology);
1899 args.write(prot);
1900 prot.writeMessageEnd();
1901 }
1902
1903 @Override
1904 public Void getResult() throws AlreadyAliveException, InvalidTopologyException, AuthorizationException, org.apache.storm.thrift.TException {
1905 if (getState() != org.apache.storm.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1906 throw new java.lang.IllegalStateException("Method call not finished!");
1907 }
1908 org.apache.storm.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.storm.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1909 org.apache.storm.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected