@Override public void start() throws Exception { FabricService fabricService = this.fabricService.get(); pool = new CloseableThreadPool("pdfs"); FabricRunnerFactory factory = fabricService.registerProtocol(PDFSProtocol.newInstance(identityProvider.get(), this.config, allocator, allowLocalAccess)); final PDFSConfig config = new PDFSConfig(pool, factory, allocator, nodeProvider, identityProvider.get(), allowLocalAccess); PseudoDistributedFileSystem.configure(config); // A hack until DX-4639 is addressed. createFileSystem(); }
@AfterClass public static void closeClient() throws Exception { service.close(); BaseTestQuery.closeClient(); }
public ServiceHolder(BufferAllocator allocator, Provider<Iterable<NodeEndpoint>> nodeProvider, PDFSMode mode, String name) throws Exception{ this.allocator = allocator.newChildAllocator(name, 0, Long.MAX_VALUE); pool = new CloseableThreadPool(name); fabric = new FabricServiceImpl(HOSTNAME, 9970, true, THREAD_COUNT, this.allocator, RESERVATION, MAX_ALLOCATION, TIMEOUT, pool); fabric.start(); endpoint = NodeEndpoint.newBuilder() .setAddress(fabric.getAddress()).setFabricPort(fabric.getPort()) .setRoles(Roles.newBuilder().setJavaExecutor(mode == PDFSMode.DATA)) .build(); service = new PDFSService(DirectProvider.wrap((FabricService) fabric), DirectProvider.wrap(endpoint), nodeProvider, DremioTest.DEFAULT_SABOT_CONFIG, this.allocator, mode); service.start(); fileSystem = service.createFileSystem(); }
@BeforeClass public static final void setupDefaultTestCluster() throws Exception { BaseTestQuery.setupDefaultTestCluster(); Map<String, FormatPluginConfig> formats = ImmutableMap.of("parquet", (FormatPluginConfig) new ParquetFormatConfig()); WorkspaceConfig workspace = new WorkspaceConfig(TEMPORARY_FOLDER.newFolder().getAbsolutePath(), true, "parquet"); String path = TEMPORARY_FOLDER.newFolder().getAbsolutePath(); BindingProvider p = getBindingProvider(); service = new PDFSService(p.provider(SabotContext.class), p.provider(FabricService.class), DremioTest.DEFAULT_SABOT_CONFIG, getSabotContext().getAllocator()); service.start(); SourceConfig c = new SourceConfig(); PDFSConf conf = new PDFSConf() ; conf.path = path; c.setType(conf.getType()); c.setName("pdfs"); c.setMetadataPolicy(CatalogService.DEFAULT_METADATA_POLICY); c.setConfig(conf.toBytesString()); ((CatalogServiceImpl) getSabotContext().getCatalogService()).getSystemUserCatalog().createSource(c); }
registry.bindSelf(new PDFSService( registry.provider(SabotContext.class), registry.provider(FabricService.class),