Package com.mobixess.jodb.core.io

Examples of com.mobixess.jodb.core.io.IRandomAccessDataBuffer.writeShort()


            arrayElementSize = byteHolder._value;
        }
       
        int objId = composeEntryID( JODBIOBase.ENTRY_OBJECT_ID, lengthEstimate);
        int objIdWithRedirectionBit = tHandle.isNewObject()? objId : JODBIOBase.addRedirectedObjectModifier(objId);
        transactionFile.writeShort(objIdWithRedirectionBit);
        writeEntryLenForID(objId,0,transactionFile);//reserve space for length
       
        long objectBodyOffset = transactionFile.getCursorOffset();
       
//        if(JODBConfig.DEBUG){
View Full Code Here


        if(tHandle.generateModificationTS()){
            transactionFile.writeLong(time);
        }
       
        //
        transactionFile.writeShort(rootObjectClassID);
       
        if(translated){
            int translatedObjectClassID = base.getOrSetClassTypeSubstitutionID(classDescr.getTypes()[0]);// base.getOrSetClassTypeSubstitutionID( objectToPersist.getClass().getName());
            transactionFile.writeShort(translatedObjectClassID);
        }
View Full Code Here

        //
        transactionFile.writeShort(rootObjectClassID);
       
        if(translated){
            int translatedObjectClassID = base.getOrSetClassTypeSubstitutionID(classDescr.getTypes()[0]);// base.getOrSetClassTypeSubstitutionID( objectToPersist.getClass().getName());
            transactionFile.writeShort(translatedObjectClassID);
        }
       
//        transactionFile.writeShort(classTypes.length);
//       
//        for (int i = 0; i < classTypes.length; i++) {
View Full Code Here

//            int id = base.getOrSetClassTypeSubstitutionID(classTypes[i]);
//            transactionFile.writeShort(id);
//        }

        if(fieldsWithAbsoluteAddr.size()>0){//with absolute offsets
            transactionFile.writeShort(fieldsWithAbsoluteAddr.size());
            for (int i = 0; i < fieldsWithAbsoluteAddr.size(); i++) {//writing links of unchanged objects
                ObjectFieldRecord next = fieldsWithAbsoluteAddr.elementAt(i);
                int id = base.getOrSetFieldSubstitutionID(next._field);
                transactionFile.writeShort(id);
                TransactionHandle valueHandle = transactionObjects.get(next._value);
View Full Code Here

        if(fieldsWithAbsoluteAddr.size()>0){//with absolute offsets
            transactionFile.writeShort(fieldsWithAbsoluteAddr.size());
            for (int i = 0; i < fieldsWithAbsoluteAddr.size(); i++) {//writing links of unchanged objects
                ObjectFieldRecord next = fieldsWithAbsoluteAddr.elementAt(i);
                int id = base.getOrSetFieldSubstitutionID(next._field);
                transactionFile.writeShort(id);
                TransactionHandle valueHandle = transactionObjects.get(next._value);
                transactionFile.writeLong(valueHandle.getHandle().getObjectEntryOffset());
            }
        }
       
View Full Code Here

            }
        }
       
        long objectsWithRelativeAddrStartOffsetShift = -1;
        if(fieldsWithRelativeAddr.size()>0){//with relative offsets
            transactionFile.writeShort(fieldsWithRelativeAddr.size());
            objectsWithRelativeAddrStartOffsetShift = transactionFile.getCursorOffset() - objectIDOffset;
            transactionFile.setLength(transactionFile.length()+ fieldsWithRelativeAddr.size()*(2+4));
            transactionFile.seek(transactionFile.length());
        }
       
View Full Code Here

            transactionFile.setLength(transactionFile.length()+ fieldsWithRelativeAddr.size()*(2+4));
            transactionFile.seek(transactionFile.length());
        }
       
        if(primitiveFields.size()>0){
            transactionFile.writeShort(primitiveFields.size());
        }
        for (int i = 0; i < primitiveFields.size(); i++) {
            Field next = primitiveFields.elementAt(i);
            int id = base.getOrSetFieldSubstitutionID(next);
            transactionFile.writeShort(id);
View Full Code Here

            transactionFile.writeShort(primitiveFields.size());
        }
        for (int i = 0; i < primitiveFields.size(); i++) {
            Field next = primitiveFields.elementAt(i);
            int id = base.getOrSetFieldSubstitutionID(next);
            transactionFile.writeShort(id);
            IndexingRecord record = IndexingRecord.findIndexingRecord(id, indexes);
            if(record!=null){
                //ByteBuffer currentlyPersistedValue = record.getPersistedDataBuffer();
                ByteBuffer pendingValue = record.getPendingDataBuffer();
                pendingValue.clear();
View Full Code Here

                replacementsFile.writeLong(existingObjectHeaderData.getOffset());
                long replacementLengthEntryOffset = replacementsFile.getCursorOffset();
                replacementsFile.writeLong(0);//reserve space for replacement length entry. //TODO skip faster?
                long newObjectIDOffset = replacementsFile.getCursorOffset();
               
                replacementsFile.writeShort(objIdWithRedirectionBit);//write new ID to replacements file
                writeEntryLenForID(objId,objectBodyLength,replacementsFile);//write length of replacements file, could be bigger than actual object's data occupies
               
                long newObjectBodyOffset = replacementsFile.getCursorOffset();
                //return to write actual length of replacement entry
                replacementsFile.seek(replacementLengthEntryOffset);
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.