Codota Logo
OhmDBImpl
Code IndexAdd Codota 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)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
FileOutputStream f =
  • Codota IconFile file;new FileOutputStream(file)
  • Codota IconString name;new FileOutputStream(name)
  • Codota IconFile file;new FileOutputStream(file, true)
  • Smart code suggestions by Codota
}
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

  • Making http requests using okhttp
  • addToBackStack (FragmentTransaction)
  • scheduleAtFixedRate (ScheduledExecutorService)
    Creates and executes a periodic action that becomes enabled first after the given initial delay, and
  • onCreateOptionsMenu (Activity)
  • ObjectMapper (com.fasterxml.jackson.databind)
    This mapper (or, data binder, or codec) provides functionality for converting between Java objects (
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • MessageFormat (java.text)
    MessageFormat provides a means to produce concatenated messages in language-neutral way. Use this to
  • ResourceBundle (java.util)
    Resource bundles contain locale-specific objects. When your program needs a locale-specific resource
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now