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


Java SegmentNodeStore类代码示例

本文整理汇总了Java中org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStore的典型用法代码示例。如果您正苦于以下问题:Java SegmentNodeStore类的具体用法?Java SegmentNodeStore怎么用?Java SegmentNodeStore使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


SegmentNodeStore类属于org.apache.jackrabbit.oak.plugins.segment包,在下文中一共展示了SegmentNodeStore类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testBackup

import org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStore; //导入依赖的package包/类
@Test
public void testBackup() throws Exception {
    FileStore source = new FileStore(src, 8, false);

    NodeStore store = new SegmentNodeStore(source);
    init(store);

    // initial content
    FileStoreBackup.backup(store, destination);

    compare(store, destination);

    addTestContent(store);
    FileStoreBackup.backup(store, destination);
    compare(store, destination);

    source.close();
}
 
开发者ID:denismo,项目名称:jackrabbit-dynamodb-store,代码行数:19,代码来源:FileStoreBackupTest.java

示例2: testInitializerSegment

import org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStore; //导入依赖的package包/类
@Test
public void testInitializerSegment() throws CommitFailedException {
    NodeStore store = new SegmentNodeStore(new MemoryStore());

    NodeBuilder builder = store.getRoot().builder();
    new InitialContent().initialize(builder);

    SecurityProviderImpl provider = new SecurityProviderImpl(
            ConfigurationParameters.of(ImmutableMap.of(UserConfiguration.NAME,
                    ConfigurationParameters.of(ImmutableMap.of("anonymousId", "anonymous",
                            "adminId", "admin",
                            "usersPath", "/home/users",
                            "groupsPath", "/home/groups",
                            "defaultDepth", "1")))));
    provider.getConfiguration(UserConfiguration.class).getWorkspaceInitializer().initialize(
            builder, "default");
    builder.getNodeState();
}
 
开发者ID:denismo,项目名称:jackrabbit-dynamodb-store,代码行数:19,代码来源:InitializerTest.java

示例3: getContentRepository

import org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStore; //导入依赖的package包/类
@Override
public ContentRepository getContentRepository() throws IOException {
        	 mongo = new MongoClient(config.getHost(), config.getPort());
        	DB db = mongo.getDB(config.getDBName());
   		if (config.getUserId() != null && !config.getUserId().isEmpty()) {
   			boolean auth = db.authenticate(config.getUserId(), config
   					.getPassword().toCharArray());
   			if (!auth)
   				throw new RuntimeException("Invalid username/password");
   		}
            store = new MongoStore(db, config.getCacheSize());
            Oak oak = setupOak(new Oak(new SegmentNodeStore(store)));
            return oak.createContentRepository();     
}
 
开发者ID:hlta,项目名称:playweb,代码行数:15,代码来源:OakSegmentRepositoryManager.java

示例4: compact

import org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStore; //导入依赖的package包/类
public void compact() {
    long start = System.nanoTime();
    log.info("TarMK compaction running");

    SegmentWriter writer = new SegmentWriter(this, tracker);
    Compactor compactor = new Compactor(writer);

    SegmentNodeState before = getHead();
    long existing = before.getChildNode(SegmentNodeStore.CHECKPOINTS)
            .getChildNodeCount(Long.MAX_VALUE);
    if (existing > 1) {
        log.warn(
                "TarMK compaction found {} checkpoints, you might need to run checkpoint cleanup",
                existing);
    }

    SegmentNodeState after = compactor.compact(EMPTY_NODE, before);
    writer.flush();
    while (!setHead(before, after)) {
        // Some other concurrent changes have been made.
        // Rebase (and compact) those changes on top of the
        // compacted state before retrying to set the head.
        SegmentNodeState head = getHead();
        after = compactor.compact(before, head);
        before = head;
        writer.flush();
    }
    tracker.setCompactionMap(compactor.getCompactionMap());

    // Drop the SegmentWriter caches and flush any existing state
    // in an attempt to prevent new references to old pre-compacted
    // content. TODO: There should be a cleaner way to do this.
    tracker.getWriter().dropCache();
    tracker.getWriter().flush();

    log.info("TarMK compaction completed in {}ms", MILLISECONDS
            .convert(System.nanoTime() - start, NANOSECONDS));
}
 
开发者ID:denismo,项目名称:jackrabbit-dynamodb-store,代码行数:39,代码来源:FileStore.java

示例5: TarConsole

import org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStore; //导入依赖的package包/类
public TarConsole(String repoPath){
   super();
   try {
      fileStore = new FileStore(new File(repoPath), 256, false);
      store = new SegmentNodeStore(fileStore); 
      root = store.getRoot();
   } catch (IOException e) {
      throw new RuntimeException("Error while opening the Tar repository",e);
   } 
}
 
开发者ID:davidegiannella,项目名称:oak-console,代码行数:11,代码来源:TarConsole.java

示例6: createNodeStore

import org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStore; //导入依赖的package包/类
@Override
public NodeStore createNodeStore() {
    return new SegmentNodeStore(new MemoryStore());
}
 
开发者ID:denismo,项目名称:jackrabbit-dynamodb-store,代码行数:5,代码来源:NodeStoreFixture.java

示例7: testRestore

import org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStore; //导入依赖的package包/类
@Test
public void testRestore() throws Exception {
    FileStore source = new FileStore(src, 8, false);

    NodeStore store = new SegmentNodeStore(source);
    init(store);

    // initial content
    FileStoreBackup.backup(store, destination);

    addTestContent(store);

    FileStoreRestore.restore(destination, store);

    compare(store, destination);

    source.close();
}
 
开发者ID:denismo,项目名称:jackrabbit-dynamodb-store,代码行数:19,代码来源:FileStoreBackupTest.java

示例8: compare

import org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStore; //导入依赖的package包/类
private static void compare(NodeStore store, File destination)
        throws IOException {
    FileStore backup = new FileStore(destination, 8, false);
    assertEquals(store.getRoot(), new SegmentNodeStore(backup).getRoot());
    backup.close();
}
 
开发者ID:denismo,项目名称:jackrabbit-dynamodb-store,代码行数:7,代码来源:FileStoreBackupTest.java

示例9: getContentRepository

import org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStore; //导入依赖的package包/类
@Override
public ContentRepository getContentRepository() throws IOException  {
	store = new FileStore(new File(new File(config.getBaseDirectory()),"TarFileStore"), config.getMaxFileSize(), config.getMemoryMapping());
       Oak oak = setupOak(new Oak(new SegmentNodeStore(store)));
       return oak.createContentRepository();
}
 
开发者ID:hlta,项目名称:playweb,代码行数:7,代码来源:OakTarRepositoryManager.java


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