Package dovetaildb.dbservice

Examples of dovetaildb.dbservice.ProcessTransactionMapper


public class StdLib {

  public static DbService makeMemoryDb() {
    BagIndexBridge b = new BagIndexBridge();
    final ProcessTransactionMapper mapper = new ProcessTransactionMapper();
    mapper.addRevsForTxn(0, new HashMap<String,Long>());
    b.setBagIndexFactory(new BagEntryFactory() {
      public BagEntry makeBagEntry(String bagName) {
        MemoryBlueSteelBagIndex bagIndex = new MemoryBlueSteelBagIndex();
        mapper.introduceBag(bagName, bagIndex);
        return new BagEntry(bagIndex);
      }
    });
    b.setTxnMapper(mapper);
    return new ScoringDbService(b);
View Full Code Here


      DbServiceUtil.sencodeMulti(ArrayBytes.EMPTY_BYTES, entry, buffer, tmpId--, false);
    }
    TrivialBagIndex puts = new TrivialBagIndex();
    long revNum = puts.commitNewRev(buffer);
    BagIndexBridge bridge = new BagIndexBridge();
    bridge.setTxnMapper(new ProcessTransactionMapper());
    bridge.setBagEntry("",new BagEntry(puts, null, revNum));
    bridge.getTxnMapper().addRevsForTxn(0, Util.literalMap().p("",revNum));
    return bridge.query("", 0, query, options);
  }
View Full Code Here

    b.setBagIndexFactory(new BagEntryFactory() {
      public BagEntry makeBagEntry(String bagName) {
        return new BagEntry(new TrivialBagIndex(), new DefaultTermEncoder(), 0);
      }
    });
    b.setTxnMapper(new ProcessTransactionMapper());
    return b;
  }
View Full Code Here

      DbServiceUtil.sencodeMulti(ArrayBytes.EMPTY_BYTES, ArrayBytes.EMPTY_BYTES, entry, buffer, tmpId--, false);
    }
    TrivialBagIndex puts = new TrivialBagIndex();
    long revNum = puts.commitNewRev(buffer);
    BagIndexBridge bridge = new BagIndexBridge();
    bridge.setTxnMapper(new ProcessTransactionMapper());
    bridge.setBagEntry("",new BagEntry(puts));
    HashMap<String,Long> revs = new HashMap<String,Long>();
    revs.put("", revNum);
    bridge.getTxnMapper().addRevsForTxn(0, revs);
    return bridge.query("", 0, query, options);
View Full Code Here

public abstract class ApiServiceTest  extends TestCase {

  protected DbService createDbService() {
    BagIndexBridge b = new BagIndexBridge();
    final ProcessTransactionMapper mapper = new ProcessTransactionMapper();
    mapper.addRevsForTxn(0, new HashMap<String,Long>());
    b.setBagIndexFactory(new BagEntryFactory() {
      public BagEntry makeBagEntry(String bagName) {
        TrivialBagIndex bagIndex = new TrivialBagIndex();
        mapper.introduceBag(bagName, bagIndex);
        return new BagEntry(bagIndex);
      }
    });
    b.setTxnMapper(mapper);
    return b;
View Full Code Here

TOP

Related Classes of dovetaildb.dbservice.ProcessTransactionMapper

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.