@SuppressWarnings("deprecation") @Test public void testSetZooKeeperInstance() { Configuration conf = new Configuration(); ConfiguratorBase.setZooKeeperInstance(this.getClass(), conf, org.apache.accumulo.core.client.ClientConfiguration.create() .withInstance("testInstanceName").withZkHosts("testZooKeepers").withSsl(true) .withZkTimeout(15000)); org.apache.accumulo.core.client.ClientConfiguration clientConf = org.apache.accumulo.core.client.ClientConfiguration.deserialize(conf.get(ConfiguratorBase .enumToConfKey(this.getClass(), ConfiguratorBase.InstanceOpts.CLIENT_CONFIG))); assertEquals("testInstanceName", clientConf .get(org.apache.accumulo.core.client.ClientConfiguration.ClientProperty.INSTANCE_NAME)); assertEquals("testZooKeepers", clientConf .get(org.apache.accumulo.core.client.ClientConfiguration.ClientProperty.INSTANCE_ZK_HOST)); assertEquals("true", clientConf.get( org.apache.accumulo.core.client.ClientConfiguration.ClientProperty.INSTANCE_RPC_SSL_ENABLED)); assertEquals("15000", clientConf.get( org.apache.accumulo.core.client.ClientConfiguration.ClientProperty.INSTANCE_ZK_TIMEOUT)); assertEquals(org.apache.accumulo.core.client.ZooKeeperInstance.class.getSimpleName(), conf .get(ConfiguratorBase.enumToConfKey(this.getClass(), ConfiguratorBase.InstanceOpts.TYPE))); }
public static void setZooKeeperInstance(Class<?> implementingClass, Configuration conf, org.apache.accumulo.core.client.ClientConfiguration clientConfig) { String key = enumToConfKey(implementingClass, InstanceOpts.TYPE); if (!conf.get(key, "").isEmpty()) { throw new IllegalStateException( "Instance info can only be set once per job; it has already been configured with " + conf.get(key)); } conf.set(key, "ZooKeeperInstance"); if (clientConfig != null) { conf.set(enumToConfKey(implementingClass, InstanceOpts.CLIENT_CONFIG), clientConfig.serialize()); } }
ConfiguratorBase { public static void setZooKeeperInstance(Class<?> implementingClass, Configuration conf, org.apache.accumulo.core.client.ClientConfiguration clientConfig) { String key = enumToConfKey(implementingClass, InstanceOpts.TYPE); if (!conf.get(key, "").isEmpty()) { throw new IllegalStateException( "Instance info can only be set once per job; it has already been configured with " + conf.get(key)); } conf.set(key, "ZooKeeperInstance"); if (clientConfig != null) { conf.set(enumToConfKey(implementingClass, InstanceOpts.CLIENT_CONFIG), clientConfig.serialize()); } } }
ConfiguratorBase { public static void setZooKeeperInstance(Class<?> implementingClass, Configuration conf, org.apache.accumulo.core.client.ClientConfiguration clientConfig) { String key = enumToConfKey(implementingClass, InstanceOpts.TYPE); if (!conf.get(key, "").isEmpty()) { throw new IllegalStateException( "Instance info can only be set once per job; it has already been configured with " + conf.get(key)); } conf.set(key, "ZooKeeperInstance"); if (clientConfig != null) { conf.set(enumToConfKey(implementingClass, InstanceOpts.CLIENT_CONFIG), clientConfig.serialize()); } }  }
ConfiguratorBase { public static void setZooKeeperInstance(Class<?> implementingClass, Configuration conf, org.apache.accumulo.core.client.ClientConfiguration clientConfig) { String key = enumToConfKey(implementingClass, InstanceOpts.TYPE); if (!conf.get(key, "").isEmpty()) { throw new IllegalStateException( "Instance info can only be set once per job; it has already been configured with " + conf.get(key)); } conf.set(key, "ZooKeeperInstance"); if (clientConfig != null) { conf.set(enumToConfKey(implementingClass, InstanceOpts.CLIENT_CONFIG), clientConfig.serialize()); } }  static void setConnectorInfo(Class<?> implementingClass, Configuration conf,
      String principal, AuthenticationToken token); static void setConnectorInfo(Class<?> implementingClass, Configuration conf,
      String principal, String tokenFile); static Boolean isConnectorInfoSet(Class<?> implementingClass, Configuration conf); static String getPrincipal(Class<?> implementingClass, Configuration conf); static AuthenticationToken getAuthenticationToken(Class<?> implementingClass,
      Configuration conf); static AuthenticationToken getTokenFromFile(Class<?> implementingClass, Configuration conf,
      String principal, String tokenFile); static void setZooKeeperInstance(Class<?> implementingClass, Configuration conf,
      org.apache.accumulo.core.client.ClientConfiguration clientConfig); static org.apache.accumulo.core.client.Instance getInstance(Class<?> implementingClass,
      Configuration conf); static org.apache.accumulo.core.client.ClientConfiguration getClientConfiguration(Class<?> implementingClass, Configuration conf); static void setLogLevel(Class<?> implementingClass, Configuration conf, Level level); static Level getLogLevel(Class<?> implementingClass, Configuration conf); static void setVisibilityCacheSize(Configuration conf, int visibilityCacheSize); static int getVisibilityCacheSize(Configuration conf); static AuthenticationToken unwrapAuthenticationToken(JobConf job,
      AuthenticationToken token); static AuthenticationToken unwrapAuthenticationToken(JobContext job,
      AuthenticationToken token); static ClientContext client(Class<?> CLASS, Configuration conf); static ClientContext client(Class<?> CLASS,
      org.apache.accumulo.core.client.mapreduce.RangeInputSplit split, Configuration conf); }
ConfiguratorBase { public static void setZooKeeperInstance(Class<?> implementingClass, Configuration conf, org.apache.accumulo.core.client.ClientConfiguration clientConfig) { String key = enumToConfKey(implementingClass, InstanceOpts.TYPE); if (!conf.get(key, "").isEmpty()) { throw new IllegalStateException( "Instance info can only be set once per job; it has already been configured with " + conf.get(key)); } conf.set(key, "ZooKeeperInstance"); if (clientConfig != null) { conf.set(enumToConfKey(implementingClass, InstanceOpts.CLIENT_CONFIG), clientConfig.serialize()); } }  static void setConnectorInfo(Class<?> implementingClass, Configuration conf,
      String principal, AuthenticationToken token); static void setConnectorInfo(Class<?> implementingClass, Configuration conf,
      String principal, String tokenFile); static Boolean isConnectorInfoSet(Class<?> implementingClass, Configuration conf); static String getPrincipal(Class<?> implementingClass, Configuration conf); static AuthenticationToken getAuthenticationToken(Class<?> implementingClass,
      Configuration conf); static AuthenticationToken getTokenFromFile(Class<?> implementingClass, Configuration conf,
      String principal, String tokenFile); static void setZooKeeperInstance(Class<?> implementingClass, Configuration conf,
      org.apache.accumulo.core.client.ClientConfiguration clientConfig); static org.apache.accumulo.core.client.Instance getInstance(Class<?> implementingClass,
      Configuration conf); static org.apache.accumulo.core.client.ClientConfiguration getClientConfiguration(Class<?> implementingClass, Configuration conf); static void setLogLevel(Class<?> implementingClass, Configuration conf, Level level); static Level getLogLevel(Class<?> implementingClass, Configuration conf); static void setVisibilityCacheSize(Configuration conf, int visibilityCacheSize); static int getVisibilityCacheSize(Configuration conf); static AuthenticationToken unwrapAuthenticationToken(JobConf job,
      AuthenticationToken token); static AuthenticationToken unwrapAuthenticationToken(JobContext job,
      AuthenticationToken token); static ClientContext client(Class<?> CLASS, Configuration conf); static ClientContext client(Class<?> CLASS,
      org.apache.accumulo.core.client.mapreduce.RangeInputSplit split, Configuration conf);  }