Package org.ozoneDB.data

Examples of org.ozoneDB.data.SimpleArrayList


    public Transaction( Env _env, User _owner ) {
        env = _env;
        taID = new TransactionID( env.keyGenerator.nextID() );
        owner = _owner;

        callStack       =       new SimpleArrayList(40);
        reset();
    }
View Full Code Here


    protected GarbageCollector(Env env) {
        super(env);
//      this.env                        =   env;
        setCurrentGarbageCollectionLevel(env.getState().intProperty(env.getState().GARBAGE_COLLECTION_LEVEL,0));
//      surelyReachableObjectsWhichHaveToBeMarkedAsSuch =   new DxListDeque;
        surelyReachableObjectsWhichHaveToBeMarkedAsSuch =   new SimpleArrayList(10000); // We expect at least 10000 entries in a busy database.
        surelyReachableObjectsWhichShouldHaveBeenProcessedButWereLockContented  =   new LinkedList();
        transactionsRequiredToComplete  =   new HashSet();
    }
View Full Code Here

            The speed gain is that method invocation may be not disturbed at all on HotSpot VMs, where
            calls to this method may be fully optimized away as long as isRunning() is constant.
        */
        if (isRunning()) {
            SimpleArrayList callStack   =   transaction.getCallStack();

           try {
                if (args!=null) {
                    ObjectContainer caller      =   (ObjectContainer) callStack.peek();

                    if (caller!=null) {

                        /*
                            There is a design decision which heavily affects performance:
                            -   Do we first check for the possibility of an OzoneProxy as parameter or
                            -   Do we first check for the cross of the border of the different sets of database objects?

                            If we use true here, the first option is used.
                            If we use false here, the first option is used.
                        */
                        if (false) {
                            /*
                                This spaghetti code is for speed.
                                -   If we find an OzoneProxy, we have to look deeper and have to synchronize
                                -   If we do not find an OzoneProxy, we do not have to look deeper and to synchronized
                            */
                            checkForPossibleOzoneProxys:
                            for (;;) {
                                for (int i = args.length-1;i>=0;i--) {
                                    if (args[i] instanceof OzoneProxy) {
                                        break checkForPossibleOzoneProxys;
                                    }
                                }
                                return;
                            }
                        }

                        boolean possibleProxyBorderCross = false;

                        synchronized (garbageCollectionLevelsLock) {
                            if (callee.getGarbageCollectionLevel()==doneReachableGarbageCollectionLevel) { // The callee belongs to the doneReachable set
                                if (caller.getGarbageCollectionLevel()!=doneReachableGarbageCollectionLevel) { // The caller does not belong to the doneReachable set
                                    // The caller may transport object references to the doneReachable set where they are not checked. The referenced objects could falsely be identified as unreachable.
                                    possibleProxyBorderCross = true;
                                }
                            }
                        }

                        if (possibleProxyBorderCross) {
                            for (int i = args.length-1;i>=0;i--) {
                                checkForProxyBorderCross(args[i]);
                            }
                        }
                    }
                }
            } finally {
                callStack.push(callee);
            }
        }
    }
View Full Code Here

            The speed gain is that method invocation may be not disturbed at all on HotSpot VMs, where
            calls to this method may be fully optimized away as long as isRunning() is constant.
        */
        if (isRunning()) {
            SimpleArrayList callStack   =   transaction.getCallStack();

            if (result!=null) {
                ObjectContainer caller      =   (ObjectContainer) callStack.peek();

                if (caller!=null) {
                    if (result instanceof OzoneCompatibleOrProxy) {
                        // An indicator that this is a border cross proxy.

                        boolean possibleProxyBorderCross = false;

                        synchronized (garbageCollectionLevelsLock) {
                            if (caller.getGarbageCollectionLevel()==doneReachableGarbageCollectionLevel) { // The caller belongs to the doneReachable set
                                if (callee.getGarbageCollectionLevel()!=doneReachableGarbageCollectionLevel) { // The callee does not belong to the doneReachable set
                                    // The caller may receive object references to the doneReachable set where they are not checked. The referenced objects could falsely be identified as unreachable.
                                    possibleProxyBorderCross = true;
                                }
                            }
                        }

                        if (possibleProxyBorderCross) {
                            if (result instanceof OzoneCompatible) {
                                checkForProxyBorderCross((OzoneCompatible) result);
                            } else { // Must be OzoneProxy
                                checkForProxyBorderCross((OzoneProxy) result);
                            }
                        }
                    }
                }
            }
            callStack.pop();
        }
    }
View Full Code Here

TOP

Related Classes of org.ozoneDB.data.SimpleArrayList

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.