Search in sources :

Example 1 with ClassStat

use of ch.ehi.ili2db.fromxtf.ClassStat in project ili2db by claeis.

the class TransferToXtf method updateObjStat.

private void updateObjStat(String tag, long sqlId) {
    if (objStat.containsKey(tag)) {
        ClassStat stat = objStat.get(tag);
        stat.addEndid(sqlId);
    } else {
        ClassStat stat = new ClassStat(tag, sqlId);
        objStat.put(tag, stat);
    }
}
Also used : ClassStat(ch.ehi.ili2db.fromxtf.ClassStat)

Example 2 with ClassStat

use of ch.ehi.ili2db.fromxtf.ClassStat in project ili2db by claeis.

the class TransferToXtf method saveObjStat.

private void saveObjStat(String iliBasketId, Long basketSqlId, String file, String topic) {
    // save it for later output to log
    basketStat.put(basketSqlId, new BasketStat(file, topic, iliBasketId, objStat));
    // setup new collection
    objStat = new HashMap<String, ClassStat>();
}
Also used : ClassStat(ch.ehi.ili2db.fromxtf.ClassStat) BasketStat(ch.ehi.ili2db.fromxtf.BasketStat)

Example 3 with ClassStat

use of ch.ehi.ili2db.fromxtf.ClassStat in project ili2db by claeis.

the class Ili2db method logStatistics.

private static void logStatistics(boolean isIli1, Map<Long, BasketStat> stat) {
    ArrayList<BasketStat> statv = new ArrayList<BasketStat>(stat.values());
    java.util.Collections.sort(statv, new java.util.Comparator<BasketStat>() {

        @Override
        public int compare(BasketStat b0, BasketStat b1) {
            int ret = b0.getFile().compareTo(b1.getFile());
            if (ret == 0) {
                ret = b0.getTopic().compareTo(b1.getTopic());
                if (ret == 0) {
                    ret = b0.getBasketId().compareTo(b1.getBasketId());
                }
            }
            return ret;
        }
    });
    for (BasketStat basketStat : statv) {
        if (isIli1) {
            EhiLogger.logState(basketStat.getFile() + ": " + basketStat.getTopic());
        } else {
            EhiLogger.logState(basketStat.getFile() + ": " + basketStat.getTopic() + " BID=" + basketStat.getBasketId());
        }
        HashMap<String, ClassStat> objStat = basketStat.getObjStat();
        ArrayList<String> classv = new ArrayList<String>(objStat.keySet());
        java.util.Collections.sort(classv, new java.util.Comparator<String>() {

            @Override
            public int compare(String b0, String b1) {
                int ret = b0.compareTo(b1);
                return ret;
            }
        });
        String nbsp = Character.toString('\u00A0');
        for (String className : classv) {
            ClassStat classStat = objStat.get(className);
            String objCount = Long.toString(classStat.getObjcount());
            if (objCount.length() < 6) {
                objCount = ch.ehi.basics.tools.StringUtility.STRING(6 - objCount.length(), ' ') + objCount;
            }
            EhiLogger.logState(nbsp + objCount + " objects in CLASS " + className);
        }
    }
}
Also used : ClassStat(ch.ehi.ili2db.fromxtf.ClassStat) BasketStat(ch.ehi.ili2db.fromxtf.BasketStat) ArrayList(java.util.ArrayList)

Aggregations

ClassStat (ch.ehi.ili2db.fromxtf.ClassStat)3 BasketStat (ch.ehi.ili2db.fromxtf.BasketStat)2 ArrayList (java.util.ArrayList)1