当前位置: 首页>>代码示例>>Java>>正文


Java TitanManagement.IndexJobFuture方法代码示例

本文整理汇总了Java中com.thinkaurelius.titan.core.schema.TitanManagement.IndexJobFuture方法的典型用法代码示例。如果您正苦于以下问题:Java TitanManagement.IndexJobFuture方法的具体用法?Java TitanManagement.IndexJobFuture怎么用?Java TitanManagement.IndexJobFuture使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.thinkaurelius.titan.core.schema.TitanManagement的用法示例。


在下文中一共展示了TitanManagement.IndexJobFuture方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testGotGIndexRemoval

import com.thinkaurelius.titan.core.schema.TitanManagement; //导入方法依赖的package包/类
@Test
public void testGotGIndexRemoval() throws InterruptedException, ExecutionException {
    clopen(option(LOG_SEND_DELAY, MANAGEMENT_LOG), Duration.ZERO,
            option(KCVSLog.LOG_READ_LAG_TIME, MANAGEMENT_LOG), Duration.ofMillis(50),
            option(LOG_READ_INTERVAL, MANAGEMENT_LOG), Duration.ofMillis(250)
    );

    final String name = "name";

    // Load Graph of the Gods
    GraphOfTheGodsFactory.loadWithoutMixedIndex(graph,
            true); // True makes the index on names unique.  Test fails when this is true.
    // Change to false and test will pass.
    newTx();
    finishSchema();

    TitanGraphIndex gindex = mgmt.getGraphIndex(name);

    // Sanity checks on the index that we assume GraphOfTheGodsFactory created
    assertNotNull(gindex);
    assertEquals(1, gindex.getFieldKeys().length);
    assertEquals(name, gindex.getFieldKeys()[0].name());
    assertEquals("internalindex", gindex.getBackingIndex());
    assertEquals(SchemaStatus.ENABLED, gindex.getIndexStatus(gindex.getFieldKeys()[0]));
    finishSchema();

    // Disable name index
    gindex = mgmt.getGraphIndex(name);
    mgmt.updateIndex(gindex, SchemaAction.DISABLE_INDEX);
    mgmt.commit();
    tx.commit();

    ManagementUtil.awaitGraphIndexUpdate(graph, name, 5, ChronoUnit.SECONDS);
    finishSchema();

    // Remove name index
    gindex = mgmt.getGraphIndex(name);
    mgmt.updateIndex(gindex, SchemaAction.REMOVE_INDEX);
    TitanManagement.IndexJobFuture gmetrics = mgmt.getIndexJobStatus(gindex);
    finishSchema();

    // Should have deleted at least one record
    assertNotEquals(0, gmetrics.get().getCustom(IndexRemoveJob.DELETED_RECORDS_COUNT));
}
 
开发者ID:graben1437,项目名称:titan1withtp3.1,代码行数:45,代码来源:TitanGraphTest.java

示例2: getRunningJob

import com.thinkaurelius.titan.core.schema.TitanManagement; //导入方法依赖的package包/类
public TitanManagement.IndexJobFuture getRunningJob(Object jobId) {
    return runningJobs.get(jobId);
}
 
开发者ID:graben1437,项目名称:titan1withtp3.1,代码行数:4,代码来源:StandardScanner.java

示例3: execute

import com.thinkaurelius.titan.core.schema.TitanManagement; //导入方法依赖的package包/类
public TitanManagement.IndexJobFuture execute() throws BackendException {
            Preconditions.checkArgument(job!=null,"Need to specify a job to execute");
            Preconditions.checkArgument(StringUtils.isNotBlank(dbName),"Need to specify a database to execute against");
            Preconditions.checkArgument(times!=null,"Need to configure the timestamp provider for this job");
            StandardBaseTransactionConfig.Builder txBuilder = new StandardBaseTransactionConfig.Builder();
            txBuilder.timestampProvider(times);

            Configuration scanConfig = manager.getFeatures().getScanTxConfig();
            if (Configuration.EMPTY != graphConfiguration) {
                scanConfig = null == scanConfig ?
                        graphConfiguration :
                        new MergedConfiguration(graphConfiguration, scanConfig);
            }
            if (null != scanConfig) {
                txBuilder.customOptions(scanConfig);
            }

//            if (!txOptions.isEmpty()) {
//                ModifiableConfiguration writeConf = GraphDatabaseConfiguration.buildConfiguration();
//                for (Map.Entry<String,Object> confEntry : txOptions.entrySet()) {
//                    writeConf.set(
//                            (ConfigOption<Object>) ConfigElement.parse(ROOT_NS, confEntry.getKey()).element,
//                            confEntry.getValue());
//                }
//                Configuration customConf = writeConf;
//                if (configuration!=Configuration.EMPTY) {
//                    customConf = new MergedConfiguration(writeConf, configuration);
//
//                }
//                txBuilder.customOptions(customConf);
//            }

            StoreTransaction storeTx = manager.beginTransaction(txBuilder.build());
            KeyColumnValueStore kcvs = manager.openDatabase(dbName);

            openStores.add(kcvs);
            try {
                StandardScannerExecutor executor = new StandardScannerExecutor(job, finishJob, kcvs, storeTx,
                        manager.getFeatures(), numProcessingThreads, workBlockSize, jobConfiguration, graphConfiguration);
                addJob(jobId,executor);
                new Thread(executor).start();
                return executor;
            } catch (Throwable e) {
                storeTx.rollback();
                throw e;
            }
        }
 
开发者ID:graben1437,项目名称:titan1withtp3.1,代码行数:48,代码来源:StandardScanner.java

示例4: getScanJobStatus

import com.thinkaurelius.titan.core.schema.TitanManagement; //导入方法依赖的package包/类
public TitanManagement.IndexJobFuture getScanJobStatus(Object jobId) {
    return scanner.getRunningJob(jobId);
}
 
开发者ID:graben1437,项目名称:titan1withtp3.1,代码行数:4,代码来源:Backend.java


注:本文中的com.thinkaurelius.titan.core.schema.TitanManagement.IndexJobFuture方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。