/** * MiniAccumuloClusterImpl will build the class path itself if not set, * but the code fails on Java 9 due to assumptions about URLClassLoader. */ public static void setConfigClassPath(MiniAccumuloConfig config) { List<String> items = Splitter.on(File.pathSeparatorChar) .splitToList(getRuntimeMXBean().getClassPath()); getConfigImpl(config).setClasspathItems(items.toArray(new String[0])); }
public void killProcess(ServerType type, ProcessReference proc) throws ProcessNotFoundException, InterruptedException { getClusterControl().killProcess(type, proc); }
/** * @return name of configured instance * * @since 1.6.0 */ public String getInstanceName() { return impl.getInstanceName(); }
@Override protected void configure(MiniAccumuloConfigImpl cfg, Configuration hadoopCoreSite) { cfg.setNumTservers(1); cfg.useMiniDFS(true); cfg.setProperty(Property.GC_FILE_ARCHIVE, "false"); }
@Override public void configure(MiniAccumuloConfigImpl cfg, Configuration hadoopCoreSite) { cfg.setProperty(Property.TSERV_MAXMEM, "10K"); cfg.setProperty(Property.TSERV_MAJC_DELAY, "0"); cfg.setMemory(ServerType.TABLET_SERVER, cfg.getMemory(ServerType.TABLET_SERVER) * 3, MemoryUnit.BYTE); }
/** * Calling this method is optional. If not set, it defaults to an empty map. * * @param siteConfig * key/values that you normally put in accumulo-site.xml can be put here. */ public MiniAccumuloConfig setSiteConfig(Map<String,String> siteConfig) { impl.setSiteConfig(siteConfig); return this; }
/** * @return the number of tservers configured for this cluster */ public int getNumTservers() { return impl.getNumTservers(); }
/** * * @param dir * An empty or nonexistant temp directoy that Accumulo and Zookeeper can store data in. * Creating the directory is left to the user. Java 7, Guava, and Junit provide methods * for creating temporary directories. * @param rootPassword * Initial root password for instance. */ public MiniAccumuloClusterImpl(File dir, String rootPassword) throws IOException { this(new MiniAccumuloConfigImpl(dir, rootPassword)); }
/** * @return the root password of this cluster configuration */ public String getRootPassword() { return impl.getRootPassword(); }
/** * @return memory configured in bytes * * @since 1.6.0 */ public long getDefaultMemory() { return impl.getDefaultMemory(); }
/** * @return zookeeper connection string */ public String getZooKeepers() { return impl.getZooKeepers(); }
/** * Stops Accumulo and Zookeeper processes. If stop is not called, there is a shutdown hook that is * setup to kill the processes. However its probably best to call stop in a finally block as soon * as possible. */ public void stop() throws IOException, InterruptedException { impl.stop(); }
/** * Calling this method is optional. If not set, defaults to 'miniInstance' * * @since 1.6.0 */ public MiniAccumuloConfig setInstanceName(String instanceName) { impl.setInstanceName(instanceName); return this; }
/** * @param serverType * get configuration for this server type * * @return memory configured in bytes, returns default if this server type is not configured * * @since 1.6.0 */ public long getMemory(ServerType serverType) { return impl.getMemory(serverType); }
/** * @return the base directory of the cluster configuration */ public File getDir() { return impl.getDir(); }
@Override public Void run() throws Exception { mac.getConnector("some_other_user", delegationToken); return null; } });
@Override public void configure(MiniAccumuloConfigImpl cfg, Configuration fsConf) { cfg.setProperty(Property.TSERV_MAJC_THROUGHPUT, RATE + "B"); cfg.setProperty(Property.TABLE_MAJC_RATIO, "20"); cfg.setProperty(Property.TABLE_FILE_COMPRESSION_TYPE, "none"); }
/** * @return a copy of the site config */ public Map<String,String> getSiteConfig() { return impl.getConfiguredSiteConfig(); }
/** * @param jdwpEnabled * should the processes run remote jdwpEnabled servers? * @return the current instance * * @since 1.6.0 */ public MiniAccumuloConfig setJDWPEnabled(boolean jdwpEnabled) { impl.setJDWPEnabled(jdwpEnabled); return this; }
@Override public void configureMiniCluster(MiniAccumuloConfigImpl cfg, Configuration hadoopCoreSite) { cfg.setProperty(Property.TSERV_MAXMEM, "5K"); cfg.setProperty(Property.TSERV_MAJC_DELAY, "100ms"); }