org.locationtech.geogig.repository.Hints.readWrite()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(8.0k)|赞(0)|评价(0)|浏览(96)

本文整理了Java中org.locationtech.geogig.repository.Hints.readWrite()方法的一些代码示例,展示了Hints.readWrite()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Hints.readWrite()方法的具体详情如下:
包路径:org.locationtech.geogig.repository.Hints
类名称:Hints
方法名:readWrite

Hints.readWrite介绍

暂无

代码示例

代码示例来源:origin: locationtech/geogig

/**
 * Constructs and returns a new read-write geogig facade, which will not be managed by this
 * GeogigCLI instance, so the calling code is responsible for closing/disposing it after usage
 * 
 * @return the constructed GeoGIG.
 */
public GeoGIG newGeoGIG() {
  return newGeoGIG(Hints.readWrite());
}

代码示例来源:origin: org.locationtech.geogig/geogig-cli

/**
 * Constructs and returns a new read-write geogig facade, which will not be managed by this
 * GeogigCLI instance, so the calling code is responsible for closing/disposing it after usage
 * 
 * @return the constructed GeoGIG.
 */
public GeoGIG newGeoGIG() {
  return newGeoGIG(Hints.readWrite());
}

代码示例来源:origin: org.locationtech.geogig/geogig-cli-core

/**
 * Constructs and returns a new read-write geogig facade, which will not be managed by this
 * GeogigCLI instance, so the calling code is responsible for closing/disposing it after usage
 * 
 * @return the constructed GeoGIG.
 */
public GeoGIG newGeoGIG() {
  return newGeoGIG(Hints.readWrite());
}

代码示例来源:origin: locationtech/geogig

/**
 * Closes the GeoGIG facade if it exists.
 */
public synchronized void close() {
  if (providedGeogig != null) {
    return;
  }
  if (geogig != null) {
    geogig.close();
    geogig = null;
  }
  this.hints = Hints.readWrite();
  this.geogigInjector = null;
}

代码示例来源:origin: org.locationtech.geogig/geogig-cli

/**
 * Closes the GeoGIG facade if it exists.
 */
public synchronized void close() {
  if (providedGeogig != null) {
    return;
  }
  if (geogig != null) {
    geogig.close();
    geogig = null;
  }
  this.hints = Hints.readWrite();
  this.geogigInjector = null;
}

代码示例来源:origin: org.locationtech.geogig/geogig-cli-core

/**
 * Closes the GeoGIG facade if it exists.
 */
public synchronized void close() {
  if (providedGeogig != null) {
    return;
  }
  if (geogig != null) {
    geogig.close();
    geogig = null;
  }
  this.hints = Hints.readWrite();
  this.geogigInjector = null;
}

代码示例来源:origin: locationtech/geogig

@Override
protected ObjectStore createObjectStore() throws IOException {
  Platform platform = new DefaultPlatform();
  platform.setWorkingDir(tmp.getRoot());
  tmp.newFolder(".geogig");
  Hints hints = Hints.readWrite().platform(platform);
  try {
    hints.set(Hints.REPOSITORY_URL, tmp.getRoot().toURI().toURL());
  } catch (MalformedURLException e) {
    throw new RuntimeException(e);
  }
  return new RocksdbObjectStore(platform, hints);
}

代码示例来源:origin: org.locationtech.geogig/geogig-rocksdb

@Override
protected ObjectStore createObjectStore() throws IOException {
  Platform platform = new DefaultPlatform();
  platform.setWorkingDir(tmp.getRoot());
  tmp.newFolder(".geogig");
  Hints hints = Hints.readWrite().platform(platform);
  try {
    hints.set(Hints.REPOSITORY_URL, tmp.getRoot().toURI().toURL());
  } catch (MalformedURLException e) {
    throw Throwables.propagate(e);
  }
  return new RocksdbObjectStore(platform, hints);
}

代码示例来源:origin: locationtech/geogig

public TestData newRepo(@NonNull String name) {
  Preconditions.checkState(!repos.containsKey(name));
  URI uri;
  try {
    uri = tmp.newFolder(name).toURI();
  } catch (IOException e) {
    throw new RuntimeException(e);
  }
  Hints hints = Hints.readWrite().uri(uri);
  hints.set(Hints.REPOSITORY_NAME, name);
  Context context = GlobalContextBuilder.builder().build(hints);
  Repository repo = context.command(InitOp.class).call();
  try {
    repo.open();
    TestData repoWorker = new TestData(repo);
    repoWorker.init();
    repos.put(name, repoWorker);
    return getRepo(name);
  } catch (Exception e) {
    throw new RuntimeException(e);
  }
}

代码示例来源:origin: locationtech/geogig

@Given("^I have a remote ref called \"([^\"]*)\"$")
public void i_have_a_remote_ref_called(String expected) throws Throwable {
  String ref = "refs/remotes/origin/" + expected;
  localRepo.geogigCLI.getGeogig(Hints.readWrite()).command(UpdateRef.class).setName(ref)
      .setNewValue(ObjectId.NULL).call();
  Optional<Ref> refValue = localRepo.geogigCLI.getGeogig(Hints.readWrite())
      .command(RefParse.class).setName(ref).call();
  assertTrue(refValue.isPresent());
  assertEquals(refValue.get().getObjectId(), ObjectId.NULL);
}

代码示例来源:origin: org.locationtech.geogig/geogig-cli

@Given("^I have a remote ref called \"([^\"]*)\"$")
public void i_have_a_remote_ref_called(String expected) throws Throwable {
  String ref = "refs/remotes/origin/" + expected;
  localRepo.geogigCLI.getGeogig(Hints.readWrite()).command(UpdateRef.class).setName(ref)
      .setNewValue(ObjectId.NULL).call();
  Optional<Ref> refValue = localRepo.geogigCLI.getGeogig(Hints.readWrite())
      .command(RefParse.class).setName(ref).call();
  assertTrue(refValue.isPresent());
  assertEquals(refValue.get().getObjectId(), ObjectId.NULL);
}

代码示例来源:origin: org.locationtech.geogig/geogig-cli-core

@Given("^I have a remote ref called \"([^\"]*)\"$")
public void i_have_a_remote_ref_called(String expected) throws Throwable {
  String ref = "refs/remotes/origin/" + expected;
  localRepo.geogigCLI.getGeogig(Hints.readWrite()).command(UpdateRef.class).setName(ref)
      .setNewValue(ObjectId.NULL).call();
  Optional<Ref> refValue = localRepo.geogigCLI.getGeogig(Hints.readWrite())
      .command(RefParse.class).setName(ref).call();
  assertTrue(refValue.isPresent());
  assertEquals(refValue.get().getObjectId(), ObjectId.NULL);
}

代码示例来源:origin: locationtech/geogig

@Test
public void testReadWrite() {
  Hints hints = Hints.readWrite();
  assertFalse(hints.getBoolean(Hints.OBJECTS_READ_ONLY));
  assertFalse(hints.getBoolean(Hints.REMOTES_READ_ONLY));
}

代码示例来源:origin: org.locationtech.geogig/geogig-cli

@Given("^I have a remote tag called \"([^\"]*)\"$")
public void i_have_a_remote_tag_called(String expected) throws Throwable {
  localRepo.geogigCLI.getGeogig(Hints.readWrite()) //
      .command(TagCreateOp.class) //
      .setName(expected) //
      .setMessage("Tagged " + expected) //
      .setCommitId(ObjectId.NULL) //
      .call();
}

代码示例来源:origin: locationtech/geogig

@Given("^I have a remote tag called \"([^\"]*)\"$")
public void i_have_a_remote_tag_called(String expected) throws Throwable {
  localRepo.geogigCLI.getGeogig(Hints.readWrite()) //
      .command(TagCreateOp.class) //
      .setName(expected) //
      .setMessage("Tagged " + expected) //
      .setCommitId(ObjectId.NULL) //
      .call();
}

代码示例来源:origin: org.locationtech.geogig/geogig-cli-core

@Given("^I have a remote tag called \"([^\"]*)\"$")
public void i_have_a_remote_tag_called(String expected) throws Throwable {
  localRepo.geogigCLI.getGeogig(Hints.readWrite()) //
      .command(TagCreateOp.class) //
      .setName(expected) //
      .setMessage("Tagged " + expected) //
      .setCommitId(ObjectId.NULL) //
      .call();
}

代码示例来源:origin: org.locationtech.geogig/geogig-cli

public List<ObjectId> insert(Feature... features) throws Exception {
  geogigCLI.close();
  GeoGIG geogig = geogigCLI.newGeoGIG(Hints.readWrite());
  Preconditions.checkNotNull(geogig);
  List<ObjectId> ids = Lists.newArrayListWithCapacity(features.length);

代码示例来源:origin: org.locationtech.geogig/geogig-cli-core

@Given("^I have a merge conflict state$")
public void I_have_a_merge_conflict_state() throws Throwable {
  I_have_conflicting_branches();
  Ref branch = localRepo.geogigCLI.getGeogig(Hints.readOnly()).command(RefParse.class)
      .setName("branch1").call().get();
  try {
    localRepo.geogigCLI.getGeogig(Hints.readWrite()).command(MergeOp.class)
        .addCommit(branch.getObjectId()).call();
    fail();
  } catch (MergeConflictsException e) {
  }
}

代码示例来源:origin: locationtech/geogig

@Given("^I have a merge conflict state$")
public void I_have_a_merge_conflict_state() throws Throwable {
  I_have_conflicting_branches();
  Ref branch = localRepo.geogigCLI.getGeogig(Hints.readOnly()).command(RefParse.class)
      .setName("branch1").call().get();
  try {
    localRepo.geogigCLI.getGeogig(Hints.readWrite()).command(MergeOp.class)
        .addCommit(branch.getObjectId()).call();
    fail();
  } catch (MergeConflictsException e) {
  }
}

代码示例来源:origin: org.locationtech.geogig/geogig-cli

@Given("^I have a merge conflict state$")
public void I_have_a_merge_conflict_state() throws Throwable {
  I_have_conflicting_branches();
  Ref branch = localRepo.geogigCLI.getGeogig(Hints.readOnly()).command(RefParse.class)
      .setName("branch1").call().get();
  try {
    localRepo.geogigCLI.getGeogig(Hints.readWrite()).command(MergeOp.class)
        .addCommit(branch.getObjectId()).call();
    fail();
  } catch (MergeConflictsException e) {
  }
}

相关文章