Examples of TupleBinding


Examples of com.sleepycat.bdb.bind.tuple.TupleBinding

        // catalog is needed for serial data format (java serialization)
        catalog = new StoredClassCatalog(env, "catalog.db", null, dbFlags);

        // use Integer tuple format and binding for keys
        TupleFormat keyFormat = new TupleFormat();
        TupleBinding keyBinding =
            TupleBinding.getPrimitiveBinding(Integer.class, keyFormat);

        // use String serial format and binding for values
        SerialFormat valueFormat =
            new SerialFormat(catalog, String.class);
View Full Code Here

Examples of com.sleepycat.bind.tuple.TupleBinding

  }

  public void ttestDumpDB()
  {
   dbt = new DbTools(); dbt.openEnv(Constants.getDBDIR(), false);
   String dbName = "QUERY_DB"; TupleBinding tpb = new IndexableDoc().getBdbBinding();
   String filename = "/home/manuk/out.txt";
   assertTrue("t5 create",  dbt.dumpDB(dbName, tpb, filename) );
   dbt.closeEnv();
   System.out.println("Completed database dump test");
  }
View Full Code Here

Examples of com.sleepycat.bind.tuple.TupleBinding

  //*-- open the database environment
  boolean readOnly = true; boolean dupFlag = false;
  dbt.openDB(Constants.EXT_FILES_DB, readOnly, dupFlag);
 
  BooleanQuery query = new BooleanQuery();
  TupleBinding tpb = new IndexableDoc().getBdbBinding();
  DatabaseEntry data = new DatabaseEntry();
  if ( dbt.fetch(key, data) )
   {
     //*-- extract the text of the document
     IndexableDoc idoc = (IndexableDoc) tpb.entryToObject(data);
     String docText = idoc.getContents().toString();
   
     //*-- tokenize the text
     analyzer.setExtractEntities(false);
     Token[] tokens = null;
View Full Code Here

Examples of com.sleepycat.bind.tuple.TupleBinding

        try
        {
            cursor = _queueDb.openCursor(null, null);
            DatabaseEntry key = new DatabaseEntry();
            DatabaseEntry value = new DatabaseEntry();
            TupleBinding binding = _queueTupleBindingFactory.getInstance();
            while (cursor.getNext(key, value, LockMode.RMW) == OperationStatus.SUCCESS)
            {
                QueueRecord queueRecord = (QueueRecord) binding.entryToObject(value);
               
                String queueName = queueRecord.getNameShortString() == null ? null :
                                        queueRecord.getNameShortString().asString();
                String owner = queueRecord.getOwner() == null ? null :
                                        queueRecord.getOwner().asString();
View Full Code Here

Examples of com.sleepycat.bind.tuple.TupleBinding

        try
        {
            cursor = _exchangeDb.openCursor(null, null);
            DatabaseEntry key = new DatabaseEntry();
            DatabaseEntry value = new DatabaseEntry();
            TupleBinding binding = new ExchangeTB();
           
            while (cursor.getNext(key, value, LockMode.RMW) == OperationStatus.SUCCESS)
            {
                ExchangeRecord exchangeRec = (ExchangeRecord) binding.entryToObject(value);

                String exchangeName = exchangeRec.getNameShortString() == null ? null :
                                      exchangeRec.getNameShortString().asString();
                String type = exchangeRec.getType() == null ? null :
                              exchangeRec.getType().asString();
View Full Code Here

Examples of com.sleepycat.bind.tuple.TupleBinding

        try
        {
            cursor = _queueBindingsDb.openCursor(null, null);
            DatabaseEntry key = new DatabaseEntry();
            DatabaseEntry value = new DatabaseEntry();
            TupleBinding binding = _bindingTupleBindingFactory.getInstance();
           
            while (cursor.getNext(key, value, LockMode.RMW) == OperationStatus.SUCCESS)
            {
                //yes, this is retrieving all the useful information from the key only.
                //For table compatibility it shall currently be left as is
                BindingKey bindingRecord = (BindingKey) binding.entryToObject(key);
               
                String exchangeName = bindingRecord.getExchangeName() == null ? null :
                                      bindingRecord.getExchangeName().asString();
                String queueName = bindingRecord.getQueueName() == null ? null :
                                   bindingRecord.getQueueName().asString();
View Full Code Here

Examples of com.sleepycat.bind.tuple.TupleBinding

            DatabaseEntry key = new DatabaseEntry();
            EntryBinding keyBinding = new AMQShortStringTB();
            keyBinding.objectToEntry(exchange.getNameShortString(), key);

            DatabaseEntry value = new DatabaseEntry();
            TupleBinding exchangeBinding = new ExchangeTB();
            exchangeBinding.objectToEntry(exchangeRec, value);

            try
            {
                _exchangeDb.put(null, key, value);
            }
View Full Code Here

Examples of com.sleepycat.bind.tuple.TupleBinding

            DatabaseEntry key = new DatabaseEntry();
            EntryBinding keyBinding = new AMQShortStringTB();
            keyBinding.objectToEntry(queueRecord.getNameShortString(), key);

            DatabaseEntry value = new DatabaseEntry();
            TupleBinding queueBinding = _queueTupleBindingFactory.getInstance();

            queueBinding.objectToEntry(queueRecord, value);
            try
            {
                _queueDb.put(null, key, value);
            }
            catch (DatabaseException e)
View Full Code Here

Examples of com.sleepycat.bind.tuple.TupleBinding

            EntryBinding keyBinding = new AMQShortStringTB();
            keyBinding.objectToEntry(queue.getNameShortString(), key);

            DatabaseEntry value = new DatabaseEntry();
            DatabaseEntry newValue = new DatabaseEntry();
            TupleBinding queueBinding = _queueTupleBindingFactory.getInstance();

            OperationStatus status = _queueDb.get(null, key, value, LockMode.DEFAULT);
            if(status == OperationStatus.SUCCESS)
            {
                //read the existing record and apply the new exclusivity setting
                QueueRecord queueRecord = (QueueRecord) queueBinding.entryToObject(value);
                queueRecord.setExclusive(queue.isExclusive());
               
                //write the updated entry to the store
                queueBinding.objectToEntry(queueRecord, newValue);
               
                _queueDb.put(null, key, newValue);
            }
            else if(status != OperationStatus.NOTFOUND)
            {
View Full Code Here

Examples of com.sleepycat.bind.tuple.TupleBinding

        DatabaseEntry key = new DatabaseEntry();
        EntryBinding keyBinding = TupleBinding.getPrimitiveBinding(Long.class);
        keyBinding.objectToEntry(messageId, key);
        DatabaseEntry value = new DatabaseEntry();
       
        TupleBinding messageBinding = _metaDataTupleBindingFactory.getInstance();
        messageBinding.objectToEntry(messageMetaData, value);
        try
        {
            _messageMetaDataDb.put(tx, key, value);
            if (_log.isDebugEnabled())
            {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.