use of com.accenture.trac.common.concurrent.ExecutionContext in project tracdap by finos.
the class FileStorageReadWriteTest method setupStorage.
@BeforeEach
void setupStorage() {
var storageProps = new Properties();
storageProps.put(IStorageManager.PROP_STORAGE_KEY, "TEST_STORAGE");
storageProps.put(LocalFileStorage.CONFIG_ROOT_PATH, storageDir.toString());
storage = new LocalFileStorage(storageProps);
execContext = new ExecutionContext(new DefaultEventExecutor(new DefaultThreadFactory("t-events")));
}
use of com.accenture.trac.common.concurrent.ExecutionContext in project tracdap by finos.
the class FileStorageReadWriteStability method setupStorage.
@BeforeAll
static void setupStorage() {
var storageProps = new Properties();
storageProps.put(IStorageManager.PROP_STORAGE_KEY, "TEST_STORAGE");
storageProps.put(LocalFileStorage.CONFIG_ROOT_PATH, storageDir.toString());
storage = new LocalFileStorage(storageProps);
execContext = new ExecutionContext(new DefaultEventExecutor(new DefaultThreadFactory("t-events")));
}
use of com.accenture.trac.common.concurrent.ExecutionContext in project tracdap by finos.
the class FileStorageOperationsTest method setupStorage.
@BeforeEach
void setupStorage() {
var storageProps = new Properties();
storageProps.put(IStorageManager.PROP_STORAGE_KEY, "TEST_STORAGE");
storageProps.put(LocalFileStorage.CONFIG_ROOT_PATH, storageDir.toString());
storage = new LocalFileStorage(storageProps);
execContext = new ExecutionContext(new DefaultEventExecutor(new DefaultThreadFactory("t-events")));
}
use of com.accenture.trac.common.concurrent.ExecutionContext in project tracdap by finos.
the class DataApiTestBase method setup.
@BeforeEach
void setup() throws Exception {
// Create storage root dir referenced in config
Files.createDirectory(tempDir.resolve(STORAGE_ROOT_DIR));
var substitutions = Map.of("${TRAC_DIR}", tempDir.toString().replace("\\", "\\\\"));
var configPath = ConfigHelpers.prepareConfig(TRAC_UNIT_CONFIG, tempDir, substitutions);
// not yet used
var keystoreKey = "";
var startup = Startup.useConfigFile(TracDataService.class, tempDir, configPath.toString(), keystoreKey);
startup.runStartupSequence();
var plugins = startup.getPlugins();
plugins.initRegularPlugins();
var config = startup.getConfig();
var platformConfig = config.loadRootConfigObject(PlatformConfig.class);
var dataSvcConfig = platformConfig.getServices().getData();
formats = new CodecManager(plugins);
storage = new StorageManager(plugins);
storage.initStorage(dataSvcConfig.getStorageMap(), formats);
execContext = new ExecutionContext(new DefaultEventExecutor());
var arrowAllocatorConfig = RootAllocator.configBuilder().allocationManagerFactory(NettyAllocationManager.FACTORY).build();
var arrowAllocator = new RootAllocator(arrowAllocatorConfig);
var dataSvcName = InProcessServerBuilder.generateName();
workerGroup = new NioEventLoopGroup(6, new DefaultThreadFactory("data-svc"));
var execRegister = new ExecutionRegister(workerGroup);
var dataSvcClientChannelBuilder = NettyChannelBuilder.forAddress("localhost", METADATA_SVC_PORT).channelType(NioSocketChannel.class).eventLoopGroup(workerGroup).directExecutor().usePlaintext();
dataSvcClientChannel = EventLoopChannel.wrapChannel(dataSvcClientChannelBuilder, workerGroup);
var metaApi = TrustedMetadataApiGrpc.newFutureStub(dataSvcClientChannel);
var dataRwSvc = new DataService(dataSvcConfig, arrowAllocator, storage, formats, metaApi);
var fileRwSvc = new FileService(dataSvcConfig, storage, metaApi);
var publicApiImpl = new TracDataApi(dataRwSvc, fileRwSvc);
dataService = InProcessServerBuilder.forName(dataSvcName).addService(publicApiImpl).executor(workerGroup).intercept(execRegister.registerExecContext()).build().start();
// Create a client channel and register for automatic graceful shutdown.
dataClientChannel = InProcessChannelBuilder.forName(dataSvcName).directExecutor().build();
dataClient = TracDataApiGrpc.newStub(dataClientChannel);
}
Aggregations