Package com.sleepycat.bind.serial

Examples of com.sleepycat.bind.serial.StoredClassCatalog


            dbConfig.setType(DatabaseType.BTREE);
        }

        // catalog is needed for serial bindings (java serialization)
        Database catalogDb = env.openDatabase(null, "catalog", null, dbConfig);
        catalog = new StoredClassCatalog(catalogDb);

        // use Integer tuple binding for key entries
        TupleBinding keyBinding =
            TupleBinding.getPrimitiveBinding(Integer.class);
View Full Code Here


            // Parse the arguments list
            parseArgs(args);
            // Open the environment and databases
            openEnv();
            // Get our class catalog (used to serialize objects)
            StoredClassCatalog classCatalog =
                new StoredClassCatalog(myClassDb);

            // Start the threads
            DBWriter[] threadArray;
            threadArray = new DBWriter[NUMTHREADS];
            for (int i = 0; i < NUMTHREADS; i++) {
View Full Code Here

        DatabaseConfig catalogConfig = new DatabaseConfig();
        catalogConfig.setTransactional(true);
        catalogConfig.setAllowCreate(true);
        catalogConfig.setType(DatabaseType.BTREE);
        catalogDb = env.openDatabase(null, "catalogDb", null, catalogConfig);
        StoredClassCatalog catalog = new StoredClassCatalog(catalogDb);

        /*
         * Create a serial binding for Event data objects.  Serial
         * bindings can be used to store any Serializable object.
         * We can use some pre-defined binding classes to convert
View Full Code Here

    Database catalogDB = BerkeleyDBFactory.getDatabase("classDB", false,
        false);
    /*
     * Instantiate the class catalog
     */
    classCatalog = new StoredClassCatalog(catalogDB);

    /*
     * Create the binding
     */
    keyBinding = new SerialBinding(classCatalog, KClass);
View Full Code Here

        false);

    /*
     * Instantiate the class catalog
     */
    classCatalog = new StoredClassCatalog(catalogDB);

    /*
     * Create the binding
     */
    keyBinding = new SerialBinding(classCatalog, KClass);
View Full Code Here

        // Create the Serial class catalog.  This holds the serialized class
        // format for all database records of serial format.
        //
        Database catalogDb = env.openDatabase(null, CLASS_CATALOG, null,
                                              dbConfig);
        javaCatalog = new StoredClassCatalog(catalogDb);

        // Open the Berkeley DB database for the part, supplier and shipment
        // stores.  The stores are opened with no duplicate keys allowed.
        //
        partDb = env.openDatabase(null, PART_STORE, null, dbConfig);
View Full Code Here

        try {
            // Open the environment and databases
            openEnv();

            // Get our class catalog (used to serialize objects)
            StoredClassCatalog classCatalog =
                new StoredClassCatalog(myClassDb);

            // Start the threads
            DBWriter[] threadArray;
            threadArray = new DBWriter[NUMTHREADS];
            for (int i = 0; i < NUMTHREADS; i++) {
View Full Code Here

        config.setReadOnly(true);
        db = DbCompat.testOpenDatabase(env, null, file, null, config);

        /* Expect exception when creating the catalog. */
        try {
            new StoredClassCatalog(db);
            fail();
        } catch (IllegalStateException e) { }
        db.close();
    }
View Full Code Here

    }

    private void createDatabase()
        throws Exception {

        catalog = new StoredClassCatalog(openDb("catalog.db"));
        factory = new TupleSerialFactory(catalog);
        assertSame(catalog, factory.getCatalog());

        store1 = openDb("store1.db");
        store2 = openDb("store2.db");
View Full Code Here

        SharedTestUtils.printTestName(getName());
        env = testEnv.open(makeTestName(testEnv), false);
        runner = new TransactionRunner(env);

        catalog = new StoredClassCatalog(openDb(CATALOG_FILE, false));
        catalog2 = new StoredClassCatalog(openDb("catalog2.db", true));

        SerialBinding keyBinding = new SerialBinding(catalog,
                                                  String.class);
        SerialBinding valueBinding = new SerialBinding(catalog,
                                                    TestSerial.class);
View Full Code Here

TOP

Related Classes of com.sleepycat.bind.serial.StoredClassCatalog

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.