DriverRemoteConnection implements RemoteConnection { protected static RequestOptions getRequestOptions(final Bytecode bytecode) { final Iterator<OptionsStrategy> itty = BytecodeUtil.findStrategies(bytecode, OptionsStrategy.class); final RequestOptions.Builder builder = RequestOptions.build(); while (itty.hasNext()) { final OptionsStrategy optionsStrategy = itty.next(); final Map<String,Object> options = optionsStrategy.getOptions(); if (options.containsKey(ARGS_EVAL_TIMEOUT)) builder.timeout((long) options.get(ARGS_EVAL_TIMEOUT)); if (options.containsKey(REQUEST_ID)) builder.overrideRequestId((UUID) options.get(REQUEST_ID)); if (options.containsKey(ARGS_BATCH_SIZE)) builder.batchSize((int) options.get(ARGS_BATCH_SIZE)); if (options.containsKey(ARGS_USER_AGENT)) builder.userAgent((String) options.get(ARGS_USER_AGENT)); } return builder.create(); } DriverRemoteConnection(final Configuration conf); private  DriverRemoteConnection(final Cluster cluster, final boolean tryCloseCluster, final String remoteTraversalSourceName);   DriverRemoteConnection(final Cluster cluster, final Configuration conf); private  DriverRemoteConnection(final Client client, final String remoteTraversalSourceName); static DriverRemoteConnection using(final Client client); static DriverRemoteConnection using(final Client client, final String remoteTraversalSourceName); static DriverRemoteConnection using(final String host, final int port); static DriverRemoteConnection using(final String host, final int port, final String remoteTraversalSourceName); static DriverRemoteConnection using(final Cluster cluster); static DriverRemoteConnection using(final Cluster cluster, final String remoteTraversalSourceName); static DriverRemoteConnection using(final String clusterConfFile); static DriverRemoteConnection using(final String clusterConfFile, final String remoteTraversalSourceName); static DriverRemoteConnection using(final Configuration conf); @Override CompletableFuture<RemoteTraversal<?, E>> submitAsync(final Bytecode bytecode); @Override void close(); @Override String toString(); static final String GREMLIN_REMOTE_DRIVER_CLUSTERFILE; static final String GREMLIN_REMOTE_DRIVER_SOURCENAME; }
@Test public void shouldBuildRequestOptions() { final UUID requestId = UUID.fromString("34a9f45f-8854-4d33-8b40-92a8171ee495"); final RequestOptions options = DriverRemoteConnection.getRequestOptions( g.with("x"). with("y", 100). with(Tokens.ARGS_BATCH_SIZE, 1000). with(Tokens.REQUEST_ID, requestId). with(Tokens.ARGS_EVAL_TIMEOUT, 100000L). with(Tokens.ARGS_USER_AGENT, "test"). V().asAdmin().getBytecode()); assertEquals(requestId, options.getOverrideRequestId().get()); assertEquals(1000, options.getBatchSize().get().intValue()); assertEquals(100000L, options.getTimeout().get().longValue()); assertEquals("test", options.getUserAgent().get()); }