@Test public void testSiteConfiguration() throws Exception { // get something we know is in the site config MiniAccumuloClusterImpl cluster = SharedMiniClusterBase.getCluster(); Map<String,String> cfg = client.getSiteConfiguration(creds); assertTrue(cfg.get("instance.dfs.dir") .startsWith(cluster.getConfig().getAccumuloDir().getAbsolutePath())); }
private int countWALsInFS(MiniAccumuloClusterImpl cluster) throws Exception { FileSystem fs = cluster.getFileSystem(); RemoteIterator<LocatedFileStatus> iterator = fs .listFiles(new Path(cluster.getConfig().getAccumuloDir() + "/wal"), true); int result = 0; while (iterator.hasNext()) { LocatedFileStatus next = iterator.next(); if (!next.isDirectory()) { result++; } } return result; } }
.substring(getCluster().getConfig().getAccumuloDir().toString().length()); Path fileArchiveDir = new Path(getCluster().getConfig().getAccumuloDir().toString(), ServerConstants.FILE_ARCHIVE_DIR);
.substring(getCluster().getConfig().getAccumuloDir().toString().length()); Path fileArchiveDir = new Path(getCluster().getConfig().getAccumuloDir().toString(), ServerConstants.FILE_ARCHIVE_DIR); .substring(getCluster().getConfig().getAccumuloDir().toString().length());
.substring(getCluster().getConfig().getAccumuloDir().toString().length()); Path fileArchiveDir = new Path(getCluster().getConfig().getAccumuloDir().toString(), ServerConstants.FILE_ARCHIVE_DIR);
mkdirs(config.getZooKeeperDir()); mkdirs(config.getWalogDir()); mkdirs(config.getAccumuloDir()); File nn = new File(config.getAccumuloDir(), "nn"); mkdirs(nn); File dn = new File(config.getAccumuloDir(), "dn"); mkdirs(dn); File dfs = new File(config.getAccumuloDir(), "dfs"); mkdirs(dfs); Configuration conf = new Configuration();
File walogs = new File(cluster.getConfig().getAccumuloDir(), ServerConstants.WAL_DIR); File walogServerDir = new File(walogs, fakeServer.replace(':', '+')); File partialHeaderWalog = new File(walogServerDir, UUID.randomUUID().toString());
File walogs = new File(cluster.getConfig().getAccumuloDir(), ServerConstants.WAL_DIR); File walogServerDir = new File(walogs, fakeServer.replace(':', '+')); File emptyWalog = new File(walogServerDir, UUID.randomUUID().toString());
@Test public void test() throws Exception { File accumuloDir = this.getCluster().getConfig().getAccumuloDir(); final Connector conn = getConnector(); final String tableName = getUniqueNames(1)[0];
@Test public void testPerTableClasspath() throws Exception { final Connector c = getConnector(); final String tableName = getUniqueNames(1)[0]; File destFile = installJar(getCluster().getConfig().getAccumuloDir(), "/TestCompactionStrat.jar"); c.tableOperations().create(tableName); c.instanceOperations().setProperty( Property.VFS_CONTEXT_CLASSPATH_PROPERTY.getKey() + "context1", destFile.toString()); c.tableOperations().setProperty(tableName, Property.TABLE_MAJC_RATIO.getKey(), "10"); c.tableOperations().setProperty(tableName, Property.TABLE_CLASSPATH.getKey(), "context1"); // EfgCompactionStrat will only compact a tablet w/ end row of 'efg'. No other tablets are // compacted. c.tableOperations().setProperty(tableName, Property.TABLE_COMPACTION_STRATEGY.getKey(), "org.apache.accumulo.test.EfgCompactionStrat"); c.tableOperations().addSplits(tableName, new TreeSet<>(Arrays.asList(new Text("efg")))); for (char ch = 'a'; ch < 'l'; ch++) writeFlush(c, tableName, ch + ""); while (countFiles(c, tableName) != 7) { UtilWaitThread.sleep(200); } }