Package com.netflix.zeno.diff

Examples of com.netflix.zeno.diff.DiffRecordValueListMap


        illegalColumns = new BitSet(columnSize);
        illegalRows = new BitSet();
    }

    private float calculateJaccardDistance(DiffRecord rec1, DiffRecord rec2) {
        DiffRecordValueListMap map1 = rec1.getValueListMap();
        DiffRecordValueListMap map2 = rec2.getValueListMap();

        int xorCardinality = 0;
        int unionCardinality = 0;


        for(DiffPropertyPath key : map1.keySet()) {
            List<Object> list1 = map1.getList(key);
            List<Object> list2 = map2.getList(key);

            if(list2 == null) {
                xorCardinality += list1.size();
            } else {
                list2 = new ArrayList<Object>(list2);
                for(Object o1 : list1) {
                    if(list2.contains(o1)) {
                        list2.remove(o1);
                        unionCardinality++;
                    } else {
                        xorCardinality++;
                    }
                }
            }
        }

        for(DiffPropertyPath key : map2.keySet()) {
            List<Object> list1 = map1.getList(key);

            if(list1 == null) {
                List<Object> list2 = map2.getList(key);
                xorCardinality += list2.size();
            }
        }

        if(xorCardinality == 0 && unionCardinality == 0) {
View Full Code Here

TOP

Related Classes of com.netflix.zeno.diff.DiffRecordValueListMap

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.