Package org.helidb.txn

Examples of org.helidb.txn.Transaction


    final int noOfAdditionalRecords = tc.getNoOfAdditionalRecords();
    System.out.println("Inserting " + noOfAdditionalRecords + " additional records in " + dbs.size() + " databases");
    long start = System.currentTimeMillis();
    for (Database<Integer, Long> db : dbs)
    {
      Transaction txn = null;
      try
      {
        if (db instanceof TransactionalDatabase<?, ?>)
        {
          txn = Transaction.startTransaction(false);
        }
        for (int i = noOfBaseRecords; i < noOfBaseRecords + noOfAdditionalRecords; i++)
        {
          db.insert(s_crs_keys[i], s_crs_values[i]);
        }
        if (db instanceof TransactionalDatabase<?, ?>)
        {
          txn.commit();
          txn = null;
        }
      }
      finally
      {
        if (txn != null)
        {
          txn.rollback();
        }
      }
    }
    long time = System.currentTimeMillis() - start;
    double res = (float) time / (noOfAdditionalRecords * dbs.size());
 
View Full Code Here


    System.out.println("Updating " + noOfAdditionalRecords + " additional records in " + dbs.size() + " databases");
    long start = System.currentTimeMillis();
    final int crsValuesLen = s_crs_values.length;
    for (Database<Integer, Long> db : dbs)
    {
      Transaction txn = null;
      try
      {
        if (db instanceof TransactionalDatabase<?, ?>)
        {
          txn = Transaction.startTransaction(false);
        }
        for (int i = noOfBaseRecords; i < noOfBaseRecords + noOfAdditionalRecords; i++)
        {
          db.update(s_crs_keys[i], s_crs_values[crsValuesLen - i - 1]);
        }
        if (db instanceof TransactionalDatabase<?, ?>)
        {
          txn.commit();
          txn = null;
        }
      }
      finally
      {
        if (txn != null)
        {
          txn.rollback();
        }
      }
    }
    long time = System.currentTimeMillis() - start;
    double res = (float) time / (noOfAdditionalRecords * dbs.size());
 
View Full Code Here

    final int noOfAdditionalRecords = tc.getNoOfAdditionalRecords();
    System.out.println("Deleting " + noOfAdditionalRecords + " additional records in " + dbs.size() + " databases");
    long start = System.currentTimeMillis();
    for (Database<Integer, Long> db : dbs)
    {
      Transaction txn = null;
      try
      {
        if (db instanceof TransactionalDatabase<?, ?>)
        {
          txn = Transaction.startTransaction(false);
        }
        for (int i = noOfBaseRecords; i < noOfBaseRecords + noOfAdditionalRecords; i++)
        {
          db.delete(s_crs_keys[i]);
        }
        if (db instanceof TransactionalDatabase<?, ?>)
        {
          txn.commit();
          txn = null;
        }
      }
      finally
      {
        if (txn != null)
        {
          txn.rollback();
        }
      }
    }
    long time = System.currentTimeMillis() - start;
    double res = (float) time / (noOfAdditionalRecords * dbs.size());
 
View Full Code Here

    System.out.println("Updating " + noOfRecords + " (all) records in " + dbs.size() + " databases");
    long start = System.currentTimeMillis();
    final int crsValuesLen = s_crs_values.length;
    for (Database<Integer, Long> db : dbs)
    {
      Transaction txn = null;
      try
      {
        if (db instanceof TransactionalDatabase<?, ?>)
        {
          txn = Transaction.startTransaction(false);
        }
        for (int i = 0; i < noOfRecords; i++)
        {
          db.update(s_crs_keys[i], s_crs_values[crsValuesLen - i - 1]);
        }
        if (db instanceof TransactionalDatabase<?, ?>)
        {
          txn.commit();
          txn = null;
        }
      }
      finally
      {
        if (txn != null)
        {
          txn.rollback();
        }
      }
    }
    long time = System.currentTimeMillis() - start;
    double res = (float) time / (noOfRecords * dbs.size());
 
View Full Code Here

    final int noOfRecords = tc.getNoOfBaseRecords();
    System.out.println("Deleting 1/3rd of " + noOfRecords + " (all) records in " + dbs.size() + " databases");
    long start = System.currentTimeMillis();
    for (Database<Integer, Long> db : dbs)
    {
      Transaction txn = null;
      try
      {
        if (db instanceof TransactionalDatabase<?, ?>)
        {
          txn = Transaction.startTransaction(false);
        }
        for (int i = 0; i < noOfRecords / 3; i++)
        {
          db.delete(s_crs_keys[3 * i]);
        }
        if (db instanceof TransactionalDatabase<?, ?>)
        {
          txn.commit();
          txn = null;
        }
      }
      finally
      {
        if (txn != null)
        {
          txn.rollback();
        }
      }
    }
    long time = System.currentTimeMillis() - start;
    double res = (float) time / ((noOfRecords / 3) * dbs.size());
 
View Full Code Here

  {
    System.out.println("Compacting " + dbs.size() + " databases");
    long start = System.currentTimeMillis();
    for (Database<?, ?> db : dbs)
    {
      Transaction txn = null;
      try
      {
        if (db instanceof TransactionalDatabase<?, ?>)
        {
          txn = Transaction.startTransaction(false);
        }
        db.compact();
        if (db instanceof TransactionalDatabase<?, ?>)
        {
          txn.commit();
          txn = null;
        }
      }
      finally
      {
        if (txn != null)
        {
          txn.rollback();
        }
      }
    }
    long time = System.currentTimeMillis() - start;
    double res = (float) time / (dbs.size());
View Full Code Here

    final int noOfRecords = tc.getNoOfBaseRecords();
    System.out.println("Inserting " + noOfRecords + " records in " + dbs.size() + " databases");
    long start = System.currentTimeMillis();
    for (Database<String, String> db : dbs)
    {
      Transaction txn = null;
      try
      {
        if (db instanceof TransactionalDatabase<?, ?>)
        {
          txn = Transaction.startTransaction(false);
        }
        for (int i = 0; i < noOfRecords; i++)
        {
          db.insert(s_vrs_keys[i], s_vrs_values[i]);
        }
        if (db instanceof TransactionalDatabase<?, ?>)
        {
          txn.commit();
          txn = null;
        }
      }
      finally
      {
        if (txn != null)
        {
          txn.rollback();
        }
      }
    }
    long time = System.currentTimeMillis() - start;
    double res = (float) time / (noOfRecords * dbs.size());
 
View Full Code Here

    final int noOfRecords = tc.getNoOfBaseRecords();
    System.out.println("Selecting " + noOfRecords + " records in " + dbs.size() + " databases");
    long start = System.currentTimeMillis();
    for (Database<String, String> db : dbs)
    {
      Transaction txn = null;
      try
      {
        if (db instanceof TransactionalDatabase<?, ?>)
        {
          txn = Transaction.startTransaction(true);
        }
        for (int i = 0; i < noOfRecords; i++)
        {
          db.get(s_vrs_keys[i]);
        }
        if (db instanceof TransactionalDatabase<?, ?>)
        {
          txn.commit();
          txn = null;
        }
      }
      finally
      {
        if (txn != null)
        {
          txn.rollback();
        }
      }
    }
    long time = System.currentTimeMillis() - start;
    double res = (float) time / (noOfRecords * dbs.size());
 
View Full Code Here

    final int noOfAdditionalRecords = tc.getNoOfAdditionalRecords();
    System.out.println("Inserting " + noOfAdditionalRecords + " additional records in " + dbs.size() + " databases");
    long start = System.currentTimeMillis();
    for (Database<String, String> db : dbs)
    {
      Transaction txn = null;
      try
      {
        if (db instanceof TransactionalDatabase<?, ?>)
        {
          txn = Transaction.startTransaction(false);
        }
        for (int i = noOfBaseRecords; i < noOfBaseRecords + noOfAdditionalRecords; i++)
        {
          db.insert(s_vrs_keys[i], s_vrs_values[i]);
        }
        if (db instanceof TransactionalDatabase<?, ?>)
        {
          txn.commit();
          txn = null;
        }
      }
      finally
      {
        if (txn != null)
        {
          txn.rollback();
        }
      }
    }
    long time = System.currentTimeMillis() - start;
    double res = (float) time / (noOfAdditionalRecords * dbs.size());
 
View Full Code Here

    System.out.println("Updating " + noOfAdditionalRecords + " additional records in " + dbs.size() + " databases");
    long start = System.currentTimeMillis();
    final int crsValuesLen = s_crs_values.length;
    for (Database<String, String> db : dbs)
    {
      Transaction txn = null;
      try
      {
        if (db instanceof TransactionalDatabase<?, ?>)
        {
          txn = Transaction.startTransaction(false);
        }
        for (int i = noOfBaseRecords; i < noOfBaseRecords + noOfAdditionalRecords; i++)
        {
          db.update(s_vrs_keys[i], s_vrs_values[crsValuesLen - i - 1]);
        }
        if (db instanceof TransactionalDatabase<?, ?>)
        {
          txn.commit();
          txn = null;
        }
      }
      finally
      {
        if (txn != null)
        {
          txn.rollback();
        }
      }
    }
    long time = System.currentTimeMillis() - start;
    double res = (float) time / (noOfAdditionalRecords * dbs.size());
 
View Full Code Here

TOP

Related Classes of org.helidb.txn.Transaction

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.