Package com.arjuna.ats.arjuna.objectstore

Examples of com.arjuna.ats.arjuna.objectstore.ObjectStore


  /*
   * Defaults to ObjectStore.OS_UNSHARED
   */
 
  if (sharedTransactionLog)
      return new ObjectStore(actionStoreType, ObjectStore.OS_SHARED);
  else
      return new ObjectStore(actionStoreType);
    }
View Full Code Here


    }
      }

      if (osObjName == null)
      {
    objectStore = new ObjectStore(smAttributes.objectStoreType, storeRoot, sharedStatus);
      }
      else
      {
    objectStore = new ObjectStore(smAttributes.objectStoreType, osObjName);
      }
  }
  else
  {
      /*
 
View Full Code Here

      {
         _tests_passed = 0 ;
         _tests_failed = 0 ;

         // needed to force TxControl static initialization
         ObjectStore os = TxControl.getStore() ;

         _transaction_1 = new AtomicAction() ;
         _transaction_2 = new AtomicAction() ;
         _transaction_3 = new AtomicAction() ;
View Full Code Here

public class AllObjUidsTest extends Test
{

    public void run (String[] args)
    {
  ObjectStore objStore = TxControl.getStore();
  boolean passed = false;
  InputObjectState ios = new InputObjectState();
  String type = "/StateManager/BasicAction/TwoPhaseCoordinator/AtomicAction/ArjunaMSXAAtomicAction";
 
  for (int i = 0; i < args.length; i++)
  {
      if (args[i].equals("-help"))
      {
    System.err.println("Usage: [-help] [-type <type name>]");
   
    System.exit(0);
      }
     
      if (args[i].equals("-type"))
      {
    type = args[i+1];

    objStore = new ObjectStore();
      }
  }

  try
  {
      if (objStore.allObjUids(type, ios, ObjectStore.OS_UNKNOWN))
      {
    Uid id = new Uid(Uid.nullUid());
     
    do
    {
        try
        {
      id.unpack(ios);
        }
        catch (Exception ex)
        {
      id = Uid.nullUid();
        }
   
        if (id.notEquals(Uid.nullUid()))
      System.err.println("Got UNKNOWN "+id);

        passed = true;
   
    } while (id.notEquals(Uid.nullUid()));
      }

      System.err.println("\n");
     
      if (objStore.allObjUids(type, ios, ObjectStore.OS_COMMITTED))
      {
    Uid id = new Uid(Uid.nullUid());
     
    do
    {
        try
        {
      id.unpack(ios);
        }
        catch (Exception ex)
        {
      id = Uid.nullUid();
        }
   
        if (id.notEquals(Uid.nullUid()))
      System.err.println("Got COMMITTED "+id);

        passed = true;
   
    } while (id.notEquals(Uid.nullUid()));
      }

      System.err.println("\n");

      if (objStore.allObjUids(type, ios, ObjectStore.OS_UNCOMMITTED))
      {
    Uid id = new Uid(Uid.nullUid());
     
    do
    {
View Full Code Here

  Thread[] t = new Thread[threads];

  System.setProperty("com.arjuna.ats.internal.arjuna.objectstore.cacheStore.size", cacheSize);

  ObjectStore store = new ObjectStore(ArjunaNames.Implementation_ObjectStore_CacheStore());

  long stime = Calendar.getInstance().getTime().getTime();
 
  for (int i = 0; (i < threads) && passed; i++)
  {
      try
      {
    t[i] = new ThreadWriter(store);
   
    t[i].start();
      }
      catch (Exception ex)
      {
    ex.printStackTrace();
   
    passed = false;
      }
  }

  for (int j = 0; j < threads; j++)
  {
      try
      {
    t[j].join();

    passed = passed && ((ThreadWriter) t[j]).passed;
      }
      catch (Exception ex)
      {
      }
  }
 
  long ftime = Calendar.getInstance().getTime().getTime();
  long timeTaken = ftime - stime;

  try
  {
      store.sync();
  }
  catch (Exception ex)
  {
  }
View Full Code Here

public class RemoveCachedTest
{
    public static void main (String[] args)
    {
  boolean passed = true;
  ObjectStore store = new ObjectStore(ArjunaNames.Implementation_ObjectStore_CacheStore());
  String type = "ArjunaMS/Destinations/a3d6227_dc656_3b77ce7e_2/Messages";
  InputObjectState buff = new InputObjectState();
 
  try
  {
      if (store.allObjUids(type, buff, ObjectStore.OS_COMMITTED))
      {
    Uid toRemove = new Uid(Uid.nullUid());
   
    do
    {
        toRemove.unpack(buff);

        if (toRemove.notEquals(Uid.nullUid()))
        {
      System.err.println("Removing "+toRemove+"\n");
     
      if (store.remove_committed(toRemove, type))
          passed = true;
      else
      {
          System.err.println("Failed for "+toRemove);
View Full Code Here

 
  for (int i = 0; i < 1000; i++)
  {
      try
      {
    ObjectStore store = null;
   
    if (!threaded)
        store = new ObjectStore(ArjunaNames.Implementation_ObjectStore_ShadowingStore());
    else
        store = new ObjectStore(ArjunaNames.Implementation_ObjectStore_CacheStore());
     
    byte[] data = new byte[10240];
    OutputObjectState state = new OutputObjectState();
    Uid u = new Uid();

    state.packBytes(data);
   
    if (store.write_committed(u, "/StateManager/LockManager/foo", state))
    {
        passed = true;
    }
    else
        passed = false;
View Full Code Here

  Thread[] t = new Thread[threads];

  System.setProperty("com.arjuna.ats.internal.arjuna.objectstore.cacheStore.size", cacheSize);

  ObjectStore store = new ObjectStore(ArjunaNames.Implementation_ObjectStore_CacheStore());

  long stime = Calendar.getInstance().getTime().getTime();
 
  for (int i = 0; (i < threads) && passed; i++)
  {
      try
      {
    t[i] = new WriterThread(store);
   
    t[i].start();
      }
      catch (Exception ex)
      {
    ex.printStackTrace();
   
    passed = false;
      }
  }

  for (int j = 0; j < threads; j++)
  {
      try
      {
    t[j].join();

    passed = passed && ((WriterThread) t[j]).passed;
      }
      catch (Exception ex)
      {
      }
  }

  long ftime = Calendar.getInstance().getTime().getTime();
  long timeTaken = ftime - stime;

  System.out.println("time for "+threads+" users is "+timeTaken);

  try
  {
      store.sync();
  }
  catch (Exception ex)
  {
  }
 
View Full Code Here

  {
      e.printStackTrace(System.err);
      assertFailure();
  }

  ObjectStore objStore = new ObjectStore(objName);

  System.out.println("\nchecking assumed valid store.");

  boolean passed = validate(objStore);

  if (passed)
  {
      // check with a known invalid implementation

      objStore = new ObjectStore();

      System.out.println("\nchecking known invalid store.");

      if (validate(objStore))
    passed = false;
View Full Code Here

      if (ObjectStoreType.valid(objStoreType))
      {
        /* discard old store before creating new */

        if (store == null)
          store = new ObjectStore(
              ObjectStoreType.typeToClassName(objStoreType));

        store.unpack(os);
        shadowMade = os.unpackBoolean();

View Full Code Here

TOP

Related Classes of com.arjuna.ats.arjuna.objectstore.ObjectStore

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.