Examples of StringBinding


Examples of com.sleepycat.bind.tuple.StringBinding

        StringBinding.stringToEntry("abc", entry);
  assertEquals(4, entry.getData().length);
        assertEquals("abc", StringBinding.entryToString(entry));

        new StringBinding().objectToEntry("abc", entry);
  assertEquals(4, entry.getData().length);

        StringBinding.stringToEntry(null, entry);
  assertEquals(2, entry.getData().length);
        assertEquals(null, StringBinding.entryToString(entry));

        new StringBinding().objectToEntry(null, entry);
  assertEquals(2, entry.getData().length);

        CharacterBinding.charToEntry('a', entry);
  assertEquals(2, entry.getData().length);
        assertEquals('a', CharacterBinding.entryToChar(entry));
View Full Code Here

Examples of com.sleepycat.bind.tuple.StringBinding

    private Map<Class<?>, TupleBinding<?>> binding = new HashMap<Class<?>, TupleBinding<?>>();
    private final DirectoryHandler handler;

    public BdbEnvironmentHandlerImpl(DirectoryHandler newHandler) {
        this.handler = newHandler;
        binding.put(String.class, new StringBinding());
        binding.put(Long.class, new LongBinding());
        binding.put(LinkedList.class, new org.jrdf.util.bdb.LongListBinding());
        binding.put(BlankNode.class, new BlankNodeBinding());
        binding.put(Node.class, new NodeBinding());
        binding.put(PredicateNode.class, new NodeBinding());
View Full Code Here

Examples of com.sleepycat.bind.tuple.StringBinding

 
        StringBinding.stringToEntry("abc", entry);
  assertEquals(4, entry.getData().length);
        assertEquals("abc", StringBinding.entryToString(entry));

        new StringBinding().objectToEntry("abc", entry);
  assertEquals(4, entry.getData().length);

        StringBinding.stringToEntry(null, entry);
  assertEquals(2, entry.getData().length);
        assertEquals(null, StringBinding.entryToString(entry));

        new StringBinding().objectToEntry(null, entry);
  assertEquals(2, entry.getData().length);

        CharacterBinding.charToEntry('a', entry);
  assertEquals(2, entry.getData().length);
        assertEquals('a', CharacterBinding.entryToChar(entry));
View Full Code Here

Examples of com.sleepycat.bind.tuple.StringBinding

        DatabaseConfig historyDbConfig = HISTORY_DB_CONFIG.toDatabaseConfig();
        historyDbConfig.setReadOnly(true);
        Database sourceHistoryDB = sourceEnv.openDatabase(
                null, URI_HISTORY_DBNAME, historyDbConfig);
        StoredSortedMap<String,Map> sourceHistoryMap = new StoredSortedMap<String,Map>(sourceHistoryDB,
                new StringBinding(), new SerialBinding<Map>(sourceClassCatalog,
                        Map.class), true);

        Iterator<Entry<String,Map>> iter = sourceHistoryMap.entrySet().iterator();
        while (iter.hasNext()) {
            Entry<String,Map> item = iter.next();
View Full Code Here

Examples of com.sleepycat.bind.tuple.StringBinding

            targetEnv = setupCopyEnvironment(envFile);
            classCatalog = targetEnv.getClassCatalog();
            historyDB = targetEnv.openDatabase(null, URI_HISTORY_DBNAME,
                    HISTORY_DB_CONFIG.toDatabaseConfig());
            historyMap = new StoredSortedMap<String,Map>(historyDB,
                    new StringBinding(), new SerialBinding<Map>(classCatalog,
                        Map.class), true);
        }

        try {
            count = copyPersistSourceToHistoryMap(new File(sourcePath), historyMap);
View Full Code Here

Examples of com.sleepycat.bind.tuple.StringBinding

        try {
            StoredClassCatalog classCatalog = bdb.getClassCatalog();
            historyDb = bdb.openDatabase(getHistoryDbName(), historyDbConfig(), true);
            historyMap = new StoredSortedMap<String, Map>(
                        historyDb,
                        new StringBinding(),
                        new SerialBinding<Map>(classCatalog, Map.class),
                        true);
        } catch (DatabaseException e) {
            throw new RuntimeException(e);
        }
View Full Code Here

Examples of com.sleepycat.bind.tuple.StringBinding

            historyDb = bdb.openDatabase(getHistoryDbName(), dbConfig, true);
            historyMap =
                new StoredSortedMap<String,Map>(
                        historyDb,
                        new StringBinding(),
                        new SerialBinding<Map>(classCatalog,Map.class),
                        true);
        } catch (DatabaseException e) {
          throw new RuntimeException(e);
        }
View Full Code Here

Examples of com.sleepycat.bind.tuple.StringBinding

        DatabaseConfig dbConfig = new DatabaseConfig();
        dbConfig.setAllowCreate(true);
        dbConfig.setDeferredWrite(true);
        Database db = bdbEnvironment.openDatabase(null, "test", dbConfig);
       
        StoredSortedMap<String, String> ssm = new StoredSortedMap<String, String>(db, new StringBinding(), new StringBinding(), true);       
        testUrlsNoMatch(ssm);  
        db.close();
        bdbEnvironment.close();
    }
View Full Code Here

Examples of com.sleepycat.bind.tuple.StringBinding

            StoredClassCatalog classCatalog = bdb.getClassCatalog();
            BdbModule.BdbConfig dbConfig = PersistProcessor.HISTORY_DB_CONFIG;

            historyDb = bdb.openDatabase(dbName, dbConfig, true);
            SerialBinding sb = new SerialBinding(classCatalog, Map.class);
            StoredSortedMap historyMap = new StoredSortedMap(historyDb, new StringBinding(), sb, true);
            store = historyMap;
        } catch (DatabaseException e) {
            throw new RuntimeException(e);
        }
    }
View Full Code Here

Examples of com.sleepycat.bind.tuple.StringBinding

            boolean isRecovery = recoveryCheckpoint != null;
            dbConfig.setAllowCreate(!isRecovery);
            whoisDb = bdb.openDatabase("whoisKnowledge", dbConfig, isRecovery);

            referralServers = new StoredSortedMap<String, String>(whoisDb,
                    new StringBinding(), new StringBinding(), true);
            urlProgress = new StoredSortedMap<String, Integer>(whoisDb,
                    new StringBinding(), new IntegerBinding(), true);
        } catch (DatabaseException e) {
            throw new RuntimeException(e);
        }
       
        isRunning = true;
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.