final SystemOptionManager opt = new SystemOptionManager(config, provider);
opt.init();
final OptionManager sess = new SessionOptionManager(opt);
new NonStrictExpectations() {
{
dbContext.getMetrics();
result = new MetricRegistry();
dbContext.getAllocator();
result = new TopLevelAllocator();
dbContext.getConfig();
result = config;
dbContext.getOptionManager();
result = opt;
dbContext.getCache();
result = cache;
dbContext.getPersistentStoreProvider();
result = provider;
}
};
final StoragePluginRegistry registry = new StoragePluginRegistry(dbContext);
registry.init();
final FunctionImplementationRegistry functionRegistry = new FunctionImplementationRegistry(config);
final DrillOperatorTable table = new DrillOperatorTable(functionRegistry);
final SchemaPlus root = SimpleOptiqSchema.createRootSchema(false);
registry.getSchemaFactory().registerSchemas(UserSession.Builder.newBuilder().setSupportComplexTypes(true).build(), root);
new NonStrictExpectations() {
{
context.getNewDefaultSchema();
result = root;
context.getStorage();
result = registry;