use of org.elasticsearch.test.cluster.NoopClusterService in project crate by crate.
the class RefreshAnalyzerTest method init.
@Before
public void init() throws Exception {
NoopClusterService clusterService = new NoopClusterService();
TestingBlobTableInfo myBlobsTableInfo = TableDefinitions.createBlobTable(myBlobsIdent, clusterService);
e = SQLExecutor.builder(clusterService).enableDefaultTables().addBlobTable(myBlobsTableInfo).build();
}
use of org.elasticsearch.test.cluster.NoopClusterService in project crate by crate.
the class CreateAlterTableStatementAnalyzerTest method init.
@Before
public void init() throws Exception {
String analyzerSettings = FulltextAnalyzerResolver.encodeSettings(Settings.builder().put("search", "foobar").build()).toUtf8();
MetaData metaData = MetaData.builder().persistentSettings(Settings.builder().put("crate.analysis.custom.analyzer.ft_search", analyzerSettings).build()).build();
ClusterState state = ClusterState.builder(ClusterName.DEFAULT).nodes(DiscoveryNodes.builder().put(new DiscoveryNode("n1", DummyTransportAddress.INSTANCE, org.elasticsearch.Version.CURRENT)).put(new DiscoveryNode("n2", DummyTransportAddress.INSTANCE, org.elasticsearch.Version.CURRENT)).put(new DiscoveryNode("n3", DummyTransportAddress.INSTANCE, org.elasticsearch.Version.CURRENT)).localNodeId("n1")).metaData(metaData).build();
e = SQLExecutor.builder(new NoopClusterService(state)).enableDefaultTables().build();
}
use of org.elasticsearch.test.cluster.NoopClusterService in project crate by crate.
the class InsertFromSubQueryAnalyzerTest method initGeneratedColumnTable.
@Before
public void initGeneratedColumnTable() throws Exception {
SQLExecutor.Builder builder = SQLExecutor.builder(new NoopClusterService()).enableDefaultTables();
TableIdent usersGeneratedIdent = new TableIdent(null, "users_generated");
TestingTableInfo.Builder usersGenerated = new TestingTableInfo.Builder(usersGeneratedIdent, SHARD_ROUTING).add("id", DataTypes.LONG).add("firstname", DataTypes.STRING).add("lastname", DataTypes.STRING).addGeneratedColumn("name", DataTypes.STRING, "firstname || ' ' || lastname", false).addPrimaryKey("id");
builder.addDocTable(usersGenerated);
e = builder.build();
}
use of org.elasticsearch.test.cluster.NoopClusterService in project crate by crate.
the class SnapshotRestoreAnalyzerTest method before.
@Before
public void before() throws Exception {
RepositoriesMetaData repositoriesMetaData = new RepositoriesMetaData(new RepositoryMetaData("my_repo", "fs", Settings.builder().put("location", "/tmp/my_repo").build()));
ClusterState clusterState = ClusterState.builder(new ClusterName("testing")).metaData(MetaData.builder().putCustom(RepositoriesMetaData.TYPE, repositoriesMetaData)).build();
NoopClusterService clusterService = new NoopClusterService(clusterState);
executor = SQLExecutor.builder(clusterService).addDocTable(USER_TABLE_INFO).addDocTable(TEST_DOC_LOCATIONS_TABLE_INFO).addDocTable(TEST_PARTITIONED_TABLE_INFO).build();
}
use of org.elasticsearch.test.cluster.NoopClusterService in project crate by crate.
the class CreateAlterPartitionedTableAnalyzerTest method init.
@Before
public void init() throws Exception {
String analyzerSettings = FulltextAnalyzerResolver.encodeSettings(Settings.builder().put("search", "foobar").build()).toUtf8();
MetaData metaData = MetaData.builder().persistentSettings(Settings.builder().put("crate.analysis.custom.analyzer.ft_search", analyzerSettings).build()).build();
ClusterState state = ClusterState.builder(ClusterName.DEFAULT).metaData(metaData).build();
e = SQLExecutor.builder(new NoopClusterService(state)).enableDefaultTables().build();
}
Aggregations