Examples of Delta


Examples of com.nothome.delta.Delta

    }

    private void computeDelta(File source, File target, OutputStream out) throws IOException {
        OutputStream guarded = new NoCloseOutputStream(out);
        GDiffWriter writer = new GDiffWriter(guarded);
        new Delta().compute(source, target, writer);
    }
View Full Code Here

Examples of com.nothome.delta.Delta

    }

    private void computeDelta(File source, File target, OutputStream out) throws IOException {
        OutputStream guarded = new NoCloseOutputStream(out);
        GDiffWriter writer = new GDiffWriter(guarded);
        new Delta().compute(source, target, writer);
    }
View Full Code Here

Examples of com.persistit.Accumulator.Delta

            _droppedCount++;
        }
    }

    private Delta freeDelta(final Delta delta) {
        final Delta next = delta.getNext();
        /*
         * If the free Delta list is already full then simply drop this one and
         * let it be garbage collected
         */
        if (_freeDeltaCount < _transactionIndex.getMaxFreeDeltaListSize()) {
View Full Code Here

Examples of com.persistit.Accumulator.Delta

        }
        return next;
    }

    Delta allocateDelta() {
        final Delta delta = _freeDeltaList;
        if (delta != null) {
            _freeDeltaList = delta.getNext();
            _freeDeltaCount--;
            return delta;
        } else {
            return new Delta();
        }
    }
View Full Code Here

Examples of com.persistit.Accumulator.Delta

        delta.setNext(_delta);
        _delta = delta;
    }

    Delta takeDelta() {
        final Delta delta = _delta;
        _delta = null;
        return delta;
    }
View Full Code Here

Examples of com.persistit.Accumulator.Delta

    Delta addDelta(final TransactionStatus status) {
        final int hashIndex = hashIndex(status.getTs());
        final TransactionIndexBucket bucket = _hashTable[hashIndex];
        bucket.lock();
        try {
            final Delta delta = bucket.allocateDelta();
            status.addDelta(delta);
            return delta;
        } finally {
            bucket.unlock();
        }
View Full Code Here

Examples of com.persistit.Accumulator.Delta

     *            The value to add or combine.
     */
    void addOrCombineDelta(final TransactionStatus status, final Accumulator accumulator, final int step,
            final long value) {
        // Check current deltas, no lock as status is single txn/thread
        Delta delta = status.getDelta();
        while (delta != null) {
            if (delta.canMerge(accumulator, step)) {
                delta.merge(value);
                return;
            }
            delta = delta.getNext();
        }
        // No compatible existing delta, create a new one
        delta = addDelta(status);
        delta.setAccumulator(accumulator);
        delta.setStep(step);
        delta.setValue(value);
    }
View Full Code Here

Examples of com.persistit.Accumulator.Delta

    Delta addDelta(final TransactionStatus status) {
        final int hashIndex = hashIndex(status.getTs());
        final TransactionIndexBucket bucket = _hashTable[hashIndex];
        bucket.lock();
        try {
            final Delta delta = bucket.allocateDelta();
            status.addDelta(delta);
            return delta;
        } finally {
            bucket.unlock();
        }
View Full Code Here

Examples of com.persistit.Accumulator.Delta

     * @return Delta that was created or modified.
     */
    Delta addOrCombineDelta(final TransactionStatus status, final Accumulator accumulator, final int step,
            final long value) {
        // Check current deltas, no lock as status is single txn/thread
        Delta delta = status.getDelta();
        while (delta != null) {
            if (delta.canMerge(accumulator, step)) {
                delta.merge(value);
                return null;
            }
            delta = delta.getNext();
        }
        // No compatible existing delta, create a new one
        delta = addDelta(status);
        delta.setAccumulator(accumulator);
        delta.setStep(step);
        delta.setValue(value);
        return delta;
    }
View Full Code Here

Examples of cpw.mods.fml.repackage.com.nothome.delta.Delta

        String deobfData = args[2]; //Path to FML's deobfusication_data.lzma
        String outputDir = args[3]; //Path to place generated .binpatch
        String killTarget = args[4]; //"true" if we should destroy the target file if it generated a successful .binpatch

        LogManager.getLogger("GENDIFF").log(Level.INFO, String.format("Creating patches at %s for %s from %s", outputDir, sourceJar, targetDir));
        Delta delta = new Delta();
        FMLDeobfuscatingRemapper remapper = FMLDeobfuscatingRemapper.INSTANCE;
        remapper.setupLoadOnly(deobfData, false);
        JarFile sourceZip = new JarFile(sourceJar);
        boolean kill = killTarget.equalsIgnoreCase("true");

        File f = new File(outputDir);
        f.mkdirs();

        for (String name : remapper.getObfedClasses())
        {
//            Logger.getLogger("GENDIFF").info(String.format("Evaluating path for data :%s",name));
            String fileName = name;
            String jarName = name;
            if (RESERVED_NAMES.contains(name.toUpperCase(Locale.ENGLISH)))
            {
                fileName = "_"+name;
            }
            File targetFile = new File(targetDir, fileName.replace('/', File.separatorChar) + ".class");
            jarName = jarName+".class";
            if (targetFile.exists())
            {
                String sourceClassName = name.replace('/', '.');
                String targetClassName = remapper.map(name).replace('/', '.');
                JarEntry entry = sourceZip.getJarEntry(jarName);

                byte[] vanillaBytes = entry != null ? ByteStreams.toByteArray(sourceZip.getInputStream(entry)) : new byte[0];
                byte[] patchedBytes = Files.toByteArray(targetFile);

                byte[] diff = delta.compute(vanillaBytes, patchedBytes);


                ByteArrayDataOutput diffOut = ByteStreams.newDataOutput(diff.length + 50);
                // Original name
                diffOut.writeUTF(name);
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.