Tabnine Logo
OhmDBImpl
Code IndexAdd Tabnine to your IDE (free)

How to use
OhmDBImpl
in
com.ohmdb.impl

Best Java code snippets using com.ohmdb.impl.OhmDBImpl (Showing top 20 results out of 315)

origin: com.gitblit.ohmdb/ohmdb

private void importRelations(long id) {
  int relN = (Integer) decode();
  for (int i = 0; i < relN; i++) {
    String relName = (String) decode();
    RelationInternals rel = (RelationInternals) relation(relName);
    int linksN = (Integer) decode();
    for (int j = 0; j < linksN; j++) {
      long linkTo = (Long) decode();
      rel.fill(id, linkTo);
    }
  }
}
origin: com.gitblit.ohmdb/ohmdb-core

public synchronized byte[] exportRecord(long id) {
  SER_HELPER.clear();
  exportColumns(id);
  exportRelations(id);
  SER_HELPER.flip();
  byte[] bytes = new byte[SER_HELPER.limit()];
  SER_HELPER.get(bytes);
  // System.out.println("EXPORTING BYTES " + bytes.length);
  return bytes;
}
origin: com.gitblit.ohmdb/ohmdb

@Override
public Object read(long id) {
  return exportRecord(id);
}
origin: com.gitblit.ohmdb/ohmdb-core

private void importColumns(long id) {
  String fullName = (String) decode();
  int colN = (Integer) decode();
  Table<Object> table = table(fullName);
  TableInternals<?> table2 = (TableInternals<?>) table;
  for (int i = 0; i < colN; i++) {
    String colName = (String) decode();
    Object colVal = decode();
    table2.fill(id, colName, colVal);
  }
}
origin: com.gitblit.ohmdb/ohmdb-core

public synchronized void importRecord(long id, byte[] bytes) {
  SER_HELPER.clear();
  SER_HELPER.put(bytes);
  SER_HELPER.flip();
  boolean importTableData = (Boolean) decode();
  if (importTableData) {
    importColumns(id);
  }
  importRelations(id);
}
origin: com.gitblit.ohmdb/ohmdb

@SuppressWarnings("unchecked")
@Override
public <T> T get(long id) {
  return (T) address(id).table.get(id);
}
origin: com.gitblit.ohmdb/ohmdb-core

public RWRelation relation(String name) {
  return relation(null, name, null);
}
origin: com.gitblit.ohmdb/ohmdb

public OhmDBImpl() {
  super(new DefaultLinkMatcher());
  dbRef = new WeakReference<Db>(this);
  this.store = new NoDataStore(this);
  addShutdownHook();
}
origin: com.gitblit.ohmdb/ohmdb

@Override
public void commit(Transaction transaction) {
  Check.arg(this.transaction == transaction, "Invalid transaction!");
  db.commit();
  TransactionInternals internals = (TransactionInternals) transaction;
  internals.getStoreTx().commit();
  this.transaction = null;
  stats.commits++;
  lockManager.globalWriteUnlock();
}
origin: com.gitblit.ohmdb/ohmdb-core

public static Db newInstance(String filename) {
  Throwable err = null;
  for (int i = 0; i < 3; i++) {
    try {
      return filename != null ? new OhmDBImpl(filename) : new OhmDBImpl();
    } catch (Exception e) {
      e.printStackTrace();
      err = e;
      U.sleep(1000);
    }
  }
  throw Errors.rte("Cannot initialize the database!", err);
}
origin: com.gitblit.ohmdb/ohmdb-core

private void deleteInTx(DatastoreTransaction tx, long id) {
  insider.deleting(clazz, id);
  E entity = get_(id);
  doTriggers(beforeDelete, TriggerAction.BEFORE_DELETE, id, entity, null);
  stats.deletes++;
  int row = row(id);
  // TODO check - changelog if not deleted rels?
  db.deleteRelsInTx(id, tx); // CHANGE #1
  size--; // CHANGE #2
  deletedCount++; // CHANGE #3
  currentlyDeleted.add(row); // CHANGE #4
  idColl.delete(id); // CHANGE #5
  ids.remove(id); // CHANGE #6
  changelog.add(TableChange.delete(id, row)); // CHANGELOG
  // TODO also delete old (renamed) columns?
  for (PropertyInfo prop : props) {
    deleteCell(tx, id, row, prop);
  }
  doTriggers(afterDelete, TriggerAction.AFTER_DELETE, id, entity, null);
  insider.deleted(clazz, id);
}
origin: com.gitblit.ohmdb/ohmdb

public synchronized void importRecord(long id, byte[] bytes) {
  SER_HELPER.clear();
  SER_HELPER.put(bytes);
  SER_HELPER.flip();
  boolean importTableData = (Boolean) decode();
  if (importTableData) {
    importColumns(id);
  }
  importRelations(id);
}
origin: com.gitblit.ohmdb/ohmdb

private void importColumns(long id) {
  String fullName = (String) decode();
  int colN = (Integer) decode();
  Table<Object> table = table(fullName);
  TableInternals<?> table2 = (TableInternals<?>) table;
  for (int i = 0; i < colN; i++) {
    String colName = (String) decode();
    Object colVal = decode();
    table2.fill(id, colName, colVal);
  }
}
origin: com.gitblit.ohmdb/ohmdb-core

@SuppressWarnings("unchecked")
@Override
public <T> T get(long id) {
  return (T) address(id).table.get(id);
}
origin: ohmdb/ohmdb

public RWRelation relation(String name) {
  return relation(null, name, null);
}
origin: com.gitblit.ohmdb/ohmdb-core

public OhmDBImpl() {
  super(new DefaultLinkMatcher());
  dbRef = new WeakReference<Db>(this);
  this.store = new NoDataStore(this);
  addShutdownHook();
}
origin: com.gitblit.ohmdb/ohmdb-core

@Override
public void commit(Transaction transaction) {
  Check.arg(this.transaction == transaction, "Invalid transaction!");
  db.commit();
  TransactionInternals internals = (TransactionInternals) transaction;
  internals.getStoreTx().commit();
  this.transaction = null;
  stats.commits++;
  lockManager.globalWriteUnlock();
}
origin: com.gitblit.ohmdb/ohmdb

public static Db newInstance(String filename) {
  Throwable err = null;
  for (int i = 0; i < 3; i++) {
    try {
      return filename != null ? new OhmDBImpl(filename) : new OhmDBImpl();
    } catch (Exception e) {
      e.printStackTrace();
      err = e;
      U.sleep(1000);
    }
  }
  throw Errors.rte("Cannot initialize the database!", err);
}
origin: com.gitblit.ohmdb/ohmdb

private void deleteInTx(DatastoreTransaction tx, long id) {
  insider.deleting(clazz, id);
  E entity = get_(id);
  doTriggers(beforeDelete, TriggerAction.BEFORE_DELETE, id, entity, null);
  stats.deletes++;
  int row = row(id);
  // TODO check - changelog if not deleted rels?
  db.deleteRelsInTx(id, tx); // CHANGE #1
  size--; // CHANGE #2
  deletedCount++; // CHANGE #3
  currentlyDeleted.add(row); // CHANGE #4
  idColl.delete(id); // CHANGE #5
  ids.remove(id); // CHANGE #6
  changelog.add(TableChange.delete(id, row)); // CHANGELOG
  // TODO also delete old (renamed) columns?
  for (PropertyInfo prop : props) {
    deleteCell(tx, id, row, prop);
  }
  doTriggers(afterDelete, TriggerAction.AFTER_DELETE, id, entity, null);
  insider.deleted(clazz, id);
}
origin: ohmdb/ohmdb

public synchronized void importRecord(long id, byte[] bytes) {
  SER_HELPER.clear();
  SER_HELPER.put(bytes);
  SER_HELPER.flip();
  boolean importTableData = (Boolean) decode();
  if (importTableData) {
    importColumns(id);
  }
  importRelations(id);
}
com.ohmdb.implOhmDBImpl

Most used methods

  • relation
  • <init>
  • addShutdownHook
  • address
  • commit
  • decode
  • deleteRelsInTx
  • exportColumns
  • exportRecord
  • exportRelations
  • failure
  • importColumns
  • failure,
  • importColumns,
  • importRelations,
  • registerTriggers,
  • rollback,
  • table,
  • getLinkMatcher

Popular in Java

  • Start an intent from android
  • requestLocationUpdates (LocationManager)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getExternalFilesDir (Context)
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • HashSet (java.util)
    HashSet is an implementation of a Set. All optional operations (adding and removing) are supported.
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now