Package bm.storage

Examples of bm.storage.Store.open()


        {
            if( sendProgressEvents )
            {
                event.dispatch();
            }
            rs.open();
            final int recordSize = rs.getRecordSize( recordId );
            if( buffer == null || recordSize > buffer.length )
            {
                buffer = Tools.secureAlloc( recordSize + GROWTH_FACTOR );
                this.buffer = buffer;
View Full Code Here


        {
            if( sendProgressEvents )
            {
                event.dispatch();
            }
            rs.open();
            baos.reset();
            node.serialize( out );
            final byte[] data = baos.toByteArray();
            if( sendProgressEvents )
            {
View Full Code Here

                );
                throw cantDropNodeException;
            }
            try
            {
                rs.open();
                if( sendProgressEvents )
                {
                    event.dispatch();
                }
                rs.deleteRecord( node.getRecordId().intValue() );
View Full Code Here

        {
            // Load directory
            if( Store.exists( name ) )
            {
                st = Store.get( name, 1 );
                st.open( false );
                final byte[] data = st.getRecord( 1 );
                final ByteArrayInputStream bais = new ByteArrayInputStream( data );
                final DBSerializerInputStream in = new DBSerializerInputStream( bais );
                directory = (Hashtable) in.readObject();
            }
View Full Code Here

    {
        Store st = null;
        try
        {
            st = Store.get( rsName, 1 );
            st.open( true );
            final ByteArrayOutputStream baos = new ByteArrayOutputStream();
            final DBSerializerOutputStream out = new DBSerializerOutputStream( baos );
            out.writeObject( directory );
            if( st.getNumRecords() > 0 )
            {
View Full Code Here

            {
                final Integer recordId = (Integer) directory.get( key );
                if( recordId != null )
                {
                    st = Store.get( rsName, 1 );
                    st.open();
                    final ByteArrayInputStream bais = new ByteArrayInputStream(
                            st.getRecord( recordId.intValue() )
                    );
                    final DBSerializerInputStream in = new DBSerializerInputStream( bais );
                    obj = in.readObject();
View Full Code Here

                final ByteArrayOutputStream baos = new ByteArrayOutputStream();
                final DBSerializerOutputStream out = new DBSerializerOutputStream( baos );
                out.writeObject( value );
                final byte[] data = baos.toByteArray();
                st = Store.get( rsName, 1 );
                st.open( true );
                if( directory.containsKey( key ) )
                {
                    final Integer recordId = (Integer) directory.get( key );
                    st.setRecord( recordId.intValue(), data );
                }
View Full Code Here

            }
            else if( directory.containsKey( key ) )
            {
                cache.remove( key );
                st = Store.get( rsName, 1 );
                st.open( true );
                st.deleteRecord( ((Integer) directory.get( key ) ).intValue() );
                directory.remove( key );
                saveDirectory();
            }
        }
View Full Code Here

            {
                System.gc();
                Store.safeDeleteRecordStore( name );
                Store.setBurstMode( !ControlledTask.isBackgroundTask() );
                rs = Store.get( name, 1 );
                rs.open( true );
                log.debug( "created recordstore" );
                final int size = in.readInt();
                log.debug( "index size (entries): " + size );
                if( size > 0 )
                {
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.