/** * Constructor to use the provided {@code GeoGIG} instance and never try to close it. */ public GeogigCLI(final GeoGIG geogig, final Console consoleReader) { this.consoleReader = consoleReader; this.platform = new DefaultPlatform(); this.providedGeogig = geogig; }
@Override public synchronized long currentTimeMillis() { boolean keep_going = true; int i = 0; long current = super.currentTimeMillis(); while (keep_going) { if (current <= lastCreatedTimestamp) { try { Thread.sleep(1); } catch (Exception e) { //do nothing } } else { lastCreatedTimestamp = current; return current; } i++; keep_going = i < 50; // don't run forever -- this should never be a problem (except for system clock resets) current = super.currentTimeMillis(); } return current; //waited too long }
/** * Constructor to use the provided {@code GeoGIG} instance and never try to close it. */ public GeogigCLI(final GeoGIG geogig, final Console consoleReader) { this.consoleReader = consoleReader; this.platform = new DefaultPlatform(); this.providedGeogig = geogig; }
public CommitBuilder() { this(new DefaultPlatform()); }
@Override public Platform get() { if (resolved == null) { Hints hints = this.hints.get(); resolved = (Platform) hints.get(Hints.PLATFORM).or(new DefaultPlatform()); } return resolved; } }
@Override protected IndexDatabase createIndexDatabase(boolean readOnly) { Platform platform = new DefaultPlatform(); Hints hints = new Hints(); hints.set(Hints.OBJECTS_READ_ONLY, readOnly); HeapIndexDatabase heapIndexDatabase = new HeapIndexDatabase(platform, hints); return heapIndexDatabase; }
@Override protected HeapObjectDatabase createOpen(boolean readOnly) { Platform platform = new DefaultPlatform(); Hints hints = new Hints(); hints.set(Hints.OBJECTS_READ_ONLY, readOnly); HeapObjectDatabase store = new HeapObjectDatabase(platform, hints); store.open(); return store; }
@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); }