@Before public void setUp() throws Exception { testDir = CommonTestingUtil.getTestDir(TEST_PATH); fs = testDir.getFileSystem(conf); }
/** * * @param dir a local directory to be created * @return the created path * @throws java.io.IOException */ public static Path getTestDir(String dir) throws IOException { Path path = new Path(dir); FileSystem fs = FileSystem.getLocal(new Configuration()); cleanupTestDir(dir); fs.mkdirs(path); return fs.makeQualified(path); }
public static QueryContext createDummyContext(TajoConf conf) { QueryContext context = new QueryContext(conf, createDummySession()); context.putAll(CommonTestingUtil.getSessionVarsForTest().getAllKeyValus()); return context; }
@Before public void setUp() throws Exception { testDir = CommonTestingUtil.getTestDir(TEST_PATH); fs = testDir.getFileSystem(conf); }
/** * * @param dir a local directory to be created * @return the created path * @throws java.io.IOException */ public static Path getTestDir(String dir) throws IOException { Path path = new Path(dir); FileSystem fs = FileSystem.getLocal(new Configuration()); cleanupTestDir(dir); fs.mkdirs(path); return fs.makeQualified(path); }
private QueryContext createQueryContext(Session session) { QueryContext newQueryContext = new QueryContext(context.getConf(), session); // Set default space uri and its root uri newQueryContext.setDefaultSpaceUri(TablespaceManager.getDefault().getUri()); newQueryContext.setDefaultSpaceRootUri(TablespaceManager.getDefault().getRootUri()); if (TajoConstants.IS_TEST_MODE) { newQueryContext.putAll(CommonTestingUtil.getSessionVarsForTest()); } // Set queryCache in session int queryCacheSize = context.getConf().getIntVar(TajoConf.ConfVars.QUERY_SESSION_QUERY_CACHE_SIZE); if (queryCacheSize > 0 && session.getQueryCache() == null) { Weigher<String, Expr> weighByLength = new Weigher<String, Expr>() { public int weigh(String key, Expr expr) { return key.length(); } }; LoadingCache<String, Expr> cache = CacheBuilder.newBuilder() .maximumWeight(queryCacheSize * 1024) .weigher(weighByLength) .expireAfterAccess(1, TimeUnit.HOURS) .build(new CacheLoader<String, Expr>() { public Expr load(String sql) throws SQLSyntaxError { return analyzer.parse(sql); } }); session.setQueryCache(cache); } return newQueryContext; }
@BeforeClass public static void setUpClass() throws Exception { rootFilePath = CommonTestingUtil.getTestDir(); }
@AfterClass public static void tearDownClass() throws Exception { CommonTestingUtil.cleanupTestDir(rootFilePath.toUri().getPath()); }
private QueryContext createQueryContext(Session session) { QueryContext newQueryContext = new QueryContext(context.getConf(), session); // Set default space uri and its root uri newQueryContext.setDefaultSpaceUri(TablespaceManager.getDefault().getUri()); newQueryContext.setDefaultSpaceRootUri(TablespaceManager.getDefault().getRootUri()); if (TajoConstants.IS_TEST_MODE) { newQueryContext.putAll(CommonTestingUtil.getSessionVarsForTest()); } // Set queryCache in session int queryCacheSize = context.getConf().getIntVar(TajoConf.ConfVars.QUERY_SESSION_QUERY_CACHE_SIZE); if (queryCacheSize > 0 && session.getQueryCache() == null) { Weigher<String, Expr> weighByLength = new Weigher<String, Expr>() { public int weigh(String key, Expr expr) { return key.length(); } }; LoadingCache<String, Expr> cache = CacheBuilder.newBuilder() .maximumWeight(queryCacheSize * 1024) .weigher(weighByLength) .expireAfterAccess(1, TimeUnit.HOURS) .build(new CacheLoader<String, Expr>() { public Expr load(String sql) throws SQLSyntaxError { return analyzer.parse(sql); } }); session.setQueryCache(cache); } return newQueryContext; }
@Before public void setUp() throws Exception { testPropertyFile = new Path(CommonTestingUtil.getTestDir(), System.currentTimeMillis() + ".properties"); metricsOutputFile = new Path(CommonTestingUtil.getTestDir(), System.currentTimeMillis() + ".out"); FileOutputStream out = new FileOutputStream(testPropertyFile.toUri().getPath()); out.write("reporter.null=org.apache.tajo.util.metrics.reporter.NullReporter\n".getBytes()); out.write("reporter.file=org.apache.tajo.util.metrics.reporter.MetricsFileScheduledReporter\n".getBytes()); out.write("reporter.console=org.apache.tajo.util.metrics.reporter.MetricsConsoleScheduledReporter\n".getBytes()); out.write("MASTER-JVM.reporters=console\n".getBytes()); out.write("MASTER.reporters=file\n".getBytes()); out.write("test-console-group.reporters=console\n".getBytes()); out.write("test-find-console-group.reporters=console,file\n".getBytes()); out.write(("MASTER.file.filename=" + metricsOutputFile.toUri().getPath() + "\n").getBytes()); out.write("MASTER.file.period=5\n".getBytes()); out.close(); }
@TearDown public void tearDown() throws IOException { CommonTestingUtil.cleanupTestDir(TEST_PATH); util.shutdownCatalogCluster(); }
@Before public void setUp() throws Exception { conf = new TajoConf(); testDir = CommonTestingUtil.getTestDir(TEST_PATH); fs = testDir.getFileSystem(conf); }
@After public void tearDown() throws Exception { CommonTestingUtil.cleanupTestDir(TEST_PATH); util.shutdownCatalogCluster(); }
@Before public void setUp() throws Exception { conf = new TajoConf(); testDir = CommonTestingUtil.getTestDir(TEST_PATH); localFs = testDir.getFileSystem(conf); }
@After public void tearDown() throws Exception { CommonTestingUtil.cleanupTestDir(TEST_PATH); util.shutdownCatalogCluster(); }
@Before public void setUp() throws Exception { conf = new TajoConf(); testDir = CommonTestingUtil.getTestDir(TEST_PATH); fs = testDir.getFileSystem(conf); }
CommonTestingUtil.cleanupTestDir(scoreLargePath.toString());
public TestCompressionStorages(String type) throws IOException { this.dataFormat = type; conf = new TajoConf(); conf.setBoolean("hive.exec.orc.zerocopy", true); testDir = CommonTestingUtil.getTestDir(TEST_PATH); fs = testDir.getFileSystem(conf); }
public TestStorages(String type, boolean splitable, boolean statsable, boolean seekable, boolean internalType) throws IOException { final String TEST_PATH = "target/test-data/TestStorages"; this.dataFormat = type; this.splitable = splitable; this.statsable = statsable; this.seekable = seekable; this.internalType = internalType; conf = new TajoConf(); if (dataFormat.equalsIgnoreCase(BuiltinStorages.RCFILE)) { conf.setInt(RCFile.RECORD_INTERVAL_CONF_STR, 100); } testDir = CommonTestingUtil.getTestDir(TEST_PATH); fs = testDir.getFileSystem(conf); }
@Before public final void setUp() throws Exception { conf = new TajoConf(); path = CommonTestingUtil.getTestDir(); }