Package org.elasticsearch.index

Examples of org.elasticsearch.index.Index


         || blobEnvironment.shardLocation(new ShardId(".blob_test", 1)).exists());
        assertTrue(blobEnvironment2.shardLocation(new ShardId(".blob_test", 0)).exists()
                || blobEnvironment2.shardLocation(new ShardId(".blob_test", 1)).exists());

        blobIndices.dropBlobTable("test").get();
        assertFalse(blobEnvironment.indexLocation(new Index(".blob_test")).exists());
        assertFalse(blobEnvironment2.indexLocation(new Index(".blob_test")).exists());
    }
View Full Code Here


                || blobEnvironment.shardLocation(new ShardId(".blob_test2", 1), tempBlobPath).exists());
        assertTrue(blobEnvironment2.shardLocation(new ShardId(".blob_test2", 0), tempBlobPath).exists()
                || blobEnvironment2.shardLocation(new ShardId(".blob_test2", 1), tempBlobPath).exists());

        blobIndices.dropBlobTable("test").get();
        assertFalse(blobEnvironment.indexLocation(new Index(".blob_test"), tempBlobPath).exists());
        assertFalse(blobEnvironment2.indexLocation(new Index(".blob_test"), tempBlobPath).exists());

        // blobs path still exists because other index is using it
        assertTrue(tempBlobPath.exists());

        blobIndices.dropBlobTable("test2").get();
        assertFalse(blobEnvironment.indexLocation(new Index(".blob_test2"), tempBlobPath).exists());
        assertFalse(blobEnvironment2.indexLocation(new Index(".blob_test2"), tempBlobPath).exists());

        // no index using the blobs path anymore, should be deleted
        assertFalse(tempBlobPath.exists());

        blobIndices.createBlobTable("test", indexSettings).get();
View Full Code Here

    }

    @Test
    public void testIndexLocation() throws Exception {
        File blobsPath = new File("/tmp/crate_blobs");
        File indexLocation = blobEnvironment.indexLocation(new Index(".blob_test"), blobsPath);
        assertThat(indexLocation.getAbsolutePath().substring(0, blobsPath.getAbsolutePath().length()),
                is(blobsPath.getAbsolutePath()));
    }
View Full Code Here

            ClusterName clusterName = mock(ClusterName.class);
            when(clusterName.value()).thenReturn("crate");
            bind(ClusterName.class).toInstance(clusterName);

            Index index = new Index(SysShardsTableInfo.IDENT.name());
            bind(Index.class).toInstance(index);

            ShardId shardId = mock(ShardId.class);
            when(shardId.getId()).thenReturn(1);
            when(shardId.getIndex()).thenAnswer(new Answer<String>() {
View Full Code Here

import org.elasticsearch.rest.RestStatus;

public class BlobsDisabledException extends IndexException {

    public BlobsDisabledException(String index) {
        super(new Index(index), "blobs not enabled on this index");
    }
View Full Code Here

                    if (isBlobIndex(current.index())) {
                        File indexLocation = null;
                        File indexBlobsPath = null;
                        if (current.settings().get(BlobIndices.SETTING_INDEX_BLOBS_PATH) != null) {
                            indexBlobsPath = new File(current.settings().get(BlobIndices.SETTING_INDEX_BLOBS_PATH));
                            indexLocation = blobEnvironment.indexLocation(new Index(current.index()), indexBlobsPath);
                        } else if (blobEnvironment.blobsPath() != null) {
                            indexLocation = blobEnvironment.indexLocation(new Index(current.index()));
                        }
                        if (indexLocation != null) {
                            // delete index blob path
                            if (indexLocation.exists()) {
                                logger.debug("[{}] Deleting blob index directory '{}'",
View Full Code Here

    }

    public AnalysisService createAnalysisService() {
        Settings settings = ImmutableSettings.settingsBuilder().loadFromClasspath("org/xbib/elasticsearch/index/analysis/decompound_analysis.json").build();

        Index index = new Index("test");

        Injector parentInjector = new ModulesBuilder().add(new SettingsModule(settings),
                new EnvironmentModule(new Environment(settings)),
                new IndicesAnalysisModule())
                .createInjector();
View Full Code Here

    }

    public AnalysisService createAnalysisService() {
        Settings settings = ImmutableSettings.settingsBuilder().loadFromClasspath("org/xbib/elasticsearch/index/analysis/german_normalization_analysis.json").build();

        Index index = new Index("test");

        Injector parentInjector = new ModulesBuilder().add(new SettingsModule(settings),
                new EnvironmentModule(new Environment(settings)),
                new IndicesAnalysisModule())
                .createInjector();
View Full Code Here

        stats = CommonStats.readCommonStats(in);
        if (in.readBoolean()) {
            int entries = in.readVInt();
            statsByShard = Maps.newHashMap();
            for (int i = 0; i < entries; i++) {
                Index index = Index.readIndexName(in);
                int indexShardListSize = in.readVInt();
                List<IndexShardStats> indexShardStats = Lists.newArrayListWithCapacity(indexShardListSize);
                for (int j = 0; j < indexShardListSize; j++) {
                    indexShardStats.add(IndexShardStats.readIndexShardStats(in));
                }
View Full Code Here

        IndexQueryParserModule queryParserModule = new IndexQueryParserModule(settings);
        queryParserModule.addQueryParser("my", PluginJsonQueryParser.class);
        queryParserModule.addFilterParser("my", PluginJsonFilterParser.class);

        Index index = new Index("test");
        Injector injector = new ModulesBuilder().add(
                new CodecModule(settings),
                new SettingsModule(settings),
                new ThreadPoolModule(settings),
                new IndicesQueriesModule(),
View Full Code Here

TOP

Related Classes of org.elasticsearch.index.Index

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.