Package com.mobixess.jodb.core.io

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


//            _logger.info("Transaction: Object "+rootObject.getClass()+" "+rootObject+" header len ="+headerLen);
//        }
       
        int primaryMask = formPrimaryObjectMask(0, fieldsWithAbsoluteAddr.size()>0, fieldsWithRelativeAddr.size()>0, primitiveFields.size()>0, translated, tHandle, classDescr);;
       
        transactionFile.writeByte(primaryMask);
       
        int secondaryMask = formSecondaryObjectMask(0, tHandle);
       
        transactionFile.writeByte(secondaryMask);
       
View Full Code Here


       
        transactionFile.writeByte(primaryMask);
       
        int secondaryMask = formSecondaryObjectMask(0, tHandle);
       
        transactionFile.writeByte(secondaryMask);
       
        short newCyclicCounter =  (short) (tHandle.getCyclicalVersionCounter()+1);
       
        if(newCyclicCounter == 256){
            newCyclicCounter = 0;
View Full Code Here

        if(newCyclicCounter == 256){
            newCyclicCounter = 0;
        }
        tHandle.setCyclicalVersionCounter(newCyclicCounter);
       
        transactionFile.writeByte(newCyclicCounter);
       
        tHandle.setTranslatedObjectDataMask((byte) primaryMask);
       
        //
        if(tHandle.generateUID()){
View Full Code Here

       
        long arrayDataShift = 0;
        if(classDescr.isArray()){
            int arrayLength = Array.getLength(objectToPersist);
            transactionFile.writeInt(arrayLength);
            transactionFile.writeByte(arrayElementSize);//write length of each element in array
            arrayDataShift = transactionFile.getCursorOffset() - objectIDOffset;
            boolean primitive = classDescr.isPrimitiveArray();
            if(primitive){//completely write primitive array
                try {
                    Utils.writePrimitiveArray(objectToPersist, classDescr.getArrayType(), 0, arrayLength, transactionFile);
View Full Code Here

               
               
                //object can fit to old spot, write it to replacements file insteard of transaction file
                IRandomAccessDataBuffer replacementsFile = tContainer.getTransactionReplacementsDataFile();
                replacementsFile.resetToEnd();
                replacementsFile.writeByte(TRANSACTION_REPLACEMENT_ENTRY_TYPE_STATIC);
                replacementsFile.writeLong(existingObjectHeaderData.getOffset());
                long replacementLengthEntryOffset = replacementsFile.getCursorOffset();
                replacementsFile.writeLong(0);//reserve space for replacement length entry. //TODO skip faster?
                long newObjectIDOffset = replacementsFile.getCursorOffset();
               
View Full Code Here

                }
                IRandomAccessDataBuffer replacementsFile = tContainer.getTransactionReplacementsDataFile();
                long offset = tHandle.getHandle().getObjectEntryOffset();//offset of record that will be replaced with redirector
                //backupObject(ioTicket, offset, tContainer);
                //write redirector entry with relative offset
                replacementsFile.writeByte(TRANSACTION_REPLACEMENT_ENTRY_TYPE_REDIRECTOR);
                replacementsFile.writeLong(offset);
                replacementsFile.writeLong(objectIDOffset);//relative offset in new data transaction file
            }
            dataContainersCache.pushObjectDataContainer(existingObjectHeaderData);
        }
View Full Code Here

        IRandomAccessDataBuffer replacementsFile =  tContainer.getTransactionReplacementsDataFile();
        DataContainersCache dataContainersCache = TransactionUtils.getObjectDataContainerCache();
        ObjectDataContainer container = dataContainersCache.pullObjectDataContainer();
        //JODBIOUtils.readObjectHeader(ioTicket, container, false);
        container.readHeader(ioTicket.getRandomAccessBuffer(),persistentObjectOffset, false);
        replacementsFile.writeByte(TRANSACTION_REPLACEMENT_ENTRY_TYPE_STATIC);
        replacementsFile.writeLong(persistentObjectOffset);//write offset of object to replace
        replacementsFile.writeLong(0);//reserving space for entry's length
        long entryOffsetStart = replacementsFile.getCursorOffset();
        TransactionUtils.writeEmptyObjectEntry(replacementsFile , container.getBodyLength());
        long entryEnd = replacementsFile.getCursorOffset();
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.