Package com.mobixess.jodb.core.io

Examples of com.mobixess.jodb.core.io.IOBase


    private static void fillArray(JODBSession session,
            boolean activation, ObjectDataContainer objectDataContainer,
            Object instance, int remainingDepth) throws IOException
    {
        IOBase base = session.getBase();
        FieldsIterator fieldsIterator = objectDataContainer.getActiveFieldsIterator();
        if(fieldsIterator == null){
            return;
        }
        FieldRecord record = objectDataContainer.getRecordCache();
View Full Code Here


            return false;//TODO add warning?
        }
        if(arraySize!=fieldsIterator.getRemainingInCurrentCategory()){
            return true;
        }
        IOBase base = context.getBase();
        JODBSession session = context.getSession();
        FieldRecord fieldRecord = objectDataContainer.getRecordCache();
        if( !classDescriptor.getArrayType().isPrimitive()  ){
            for (int i = 0; i < arraySize; i++) {
                fieldsIterator.next(fieldRecord, base);
View Full Code Here

            if(_fieldsIterator == null){
                _container.reset();
                _fieldsIterator = _container.readObject(_context, _objectOffset, true);
            }
            FieldRecord record = _container.getRecordCache();
            IOBase base = _context.getBase();
            final String stringClassName = String.class.getName()
            while(_fieldsIterator.hasNext()){
                _fieldsIterator.next(record, base, false);
                int fieldPos = _classDescriptor.getFieldIndexForID(record._fieldID);
                if(fieldPos < 0) {
View Full Code Here

        }
    }
   
    public void runResolve(JODBSessionContainer sessionContainer) throws IOException{
        Iterator<Object> iter = _transactionObjects.keySet().iterator();
        IOBase base = _session.getBase();
        ITransactionResolver transactionResolver = _transactionResolver;
        while (iter.hasNext()) {
            Object element = iter.next();
            TransactionHandle tHandle = _transactionObjects.get(element);
            if(!tHandle.isNewObject()){
                PersistentObjectHandle handle = tHandle.getHandle();
                int activeObjectHash = tHandle.getIdentityHash();
                byte version = (byte) tHandle.getCyclicalVersionCounter();
                ObjectIdentity objectIdentity = base.checkObjectChanged(handle.getObjectEntryOffset(), activeObjectHash, version);
                if(objectIdentity!=null){
                    if(_transactionResolver!=null && !transactionResolver.resolve(element, sessionContainer,null)){
                        iter.remove();
                        continue;
                    }
View Full Code Here

    }
   
    @SuppressWarnings("unchecked")
    public ObjectSet execute(JODBSession session, Predicate predicate, Comparator comparator) throws IOException
    {
        IOBase base = session.getBase();
        IOTicket ticket = base.getIOTicket(true, false);
        try {
            JODBOperationContext context = new JODBOperationContext(session, ticket, null, null,null);
            INqLoader loader = getLoader(context, predicate, comparator);
            if(!loader.isPredicateOptimized() || !loader.isComparatorOptimized()){
                return executeUnoptimized(session, predicate, comparator, loader);
            }
            Class predicateSubjectClass = loader.getPredicateSubjectClass();
            //ClassDescriptor predicateSubjectClassDescriptor = session.getDescriptorForClass(predicateSubjectClass);
            //Method setProxyMethod = loader.getSyntheticProxySetMethod();
            //Class syntheticPredicate;

            Class syntheticPredicateSubjectClass = loader.loadClass(predicateSubjectClass.getName());
            SyntheticSubject syntheticSubject  = new SyntheticSubject(context, loader,syntheticPredicateSubjectClass);
           
            Class syntheticPredicateClass = loader.loadClass(predicate.getClass().getName());
            Predicate syntheticPredicate  = (Predicate) instantiateSyntheticPredicate(session, predicate, syntheticPredicateClass);// (Predicate)syntheticPredicateClass.newInstance();
           
            Comparator syntheticComparator = null;
            if(comparator!=null){
                Class syntheticComparatorClass = loader.loadClass(comparator.getClass().getName());
                syntheticComparator = (Comparator) instantiateSyntheticPredicate(session, comparator, syntheticComparatorClass);
                //(Comparator) session.getDescriptorForClass(syntheticComparatorClass).newInstance();
            }
           
            //int[] predicateSubjectFields = loader.getPredicateSubjectFields();
            JODBIndexingRootAgent indexingRootAgent = session.getIndexingRootAgent();
            JODBIndexingAgent indexingAgent = null;
            Iterator<Integer> predicateSubjectAccessedFields = loader.getAccessedPredicateSubjectFields();
            while (predicateSubjectAccessedFields.hasNext() && indexingAgent == null) {
                indexingAgent = indexingRootAgent.getIndexingAgent(predicateSubjectAccessedFields.next(), session.getBase());
            }
            ByteBuffer indexDataBuffer = null;
            int indexField = -1;
            IndexDataIterator indexIterator = null;
            if(indexingAgent!=null){
                indexField = indexingAgent.getFieldId();
                indexDataBuffer = ByteBuffer.allocate(16);
                indexIterator = indexingAgent.getIndexIterator(true);
            }
           
            if(indexIterator==null){
                indexIterator = new LArrayIndexIterator(base.getForAllObjects(ticket));
            }

            SyntheticSubject syntheticSubjectPrev = null;
            COMPARISON_STATE comparison_state= COMPARISON_STATE.UNKNOWN;
            LArrayChunkedBuffer acceptedIdsBuffer = new LArrayChunkedBuffer();
View Full Code Here

        //return null;
    }
   
    @SuppressWarnings("unchecked")
    private ObjectSet executeUnoptimized(JODBSession session, Predicate predicate, Comparator comparator, INqLoader loader) throws IOException{
        IOBase base = session.getBase();
        IOTicket ticket = base.getIOTicket(true, false);
        try {

           
            Class predicateSubjectClass = loader.getPredicateSubjectClass();

            JODBIndexingRootAgent indexingRootAgent = session.getIndexingRootAgent();
            JODBIndexingAgent indexingAgent = null;
            Iterator<Integer> predicateSubjectAccessedFields = loader.getAccessedPredicateSubjectFields();
            if(predicateSubjectAccessedFields != null){
                while (predicateSubjectAccessedFields.hasNext() && indexingAgent == null) {//TODO may be useless if analysis incomplete
                    Integer fieldId = predicateSubjectAccessedFields.next();
                    if(fieldId!=null){
                        indexingAgent = indexingRootAgent.getIndexingAgent(fieldId, session.getBase());
                    }
                }
            }

            IndexDataIterator indexIterator = null;
            if(indexingAgent!=null){
                indexIterator = indexingAgent.getIndexIterator(true);
            }
           
            if(indexIterator==null){
                indexIterator = new LArrayIndexIterator(base.getForAllObjects(ticket));
            }

            COMPARISON_STATE comparison_state= COMPARISON_STATE.UNKNOWN;
            LArrayChunkedBuffer acceptedIdsBuffer = new LArrayChunkedBuffer();
            Object previous = null;
View Full Code Here

TOP

Related Classes of com.mobixess.jodb.core.io.IOBase

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.