stools-core/src/main/java/ch/uzh/ddis/stools/scheduler/SchedulingMetricsCollectionHook.java
private static Map<Integer, AtomicLong> createEmptySendgraphMap() {
        return new HashMap<Integer, AtomicLong>() {
            @Override
            public AtomicLong get(Object key) {
                AtomicLong result = super.get(key);
                if (result == null) {
                    result = new AtomicLong();
                    put((Integer) key, result);
                }
                return result;
            }

            @Override
            public String toString() {
                StringBuilder sb = new StringBuilder();
                for (Map.Entry<Integer, AtomicLong> entry : entrySet()) {
                    if (sb.length() > 0) {
                        sb.append(" ");
                    }
                    sb.append(entry.getKey()).append(":").append(entry.getValue().get());
                }
                return sb.toString();
            }
        };
    }
/**
     * Create an empty sendgraph map which will return 0L values for each non-existing entry. The semantics
     * of the entries in this map are 'how many messages have been sent from the task this hook is attached to
     * to other tasks in the storm task graph'. The source task id is therefore implicit.
     */
Create an empty sendgraph map which will return 0L values for each non-existing entry. The semantics
of the entries in this map are 'how many messages have been sent from the task this hook is attached to
to other tasks in the storm task graph'. The source task id is therefore implicit.
Create an empty sendgraph map which will return 0L values for each non - existing entry . The semantics of the entries in this map are ' how many messages have been sent from the task this hook is attached to to other tasks in the storm task graph ' . The source task id is therefore implicit .
private static Map<Integer, AtomicLong> createEmptySendgraphMap() {
        return new HashMap<Integer, AtomicLong>() {
            @Override
            public AtomicLong get(Object key) {
                AtomicLong result = super.get(key);
                if (result == null) {
                    result = new AtomicLong();
                    put((Integer) key, result);
                }
                return result;
            }
            @Override
            public String toString() {
                StringBuilder sb = new StringBuilder();
                for (Map.Entry<Integer, AtomicLong> entry : entrySet()) {
                    if (sb.length() > 0) {
                        sb.append(" ");
                    }
                    sb.append(entry.getKey()).append(":").append(entry.getValue().get());
                }
                return sb.toString();
            }
        };
    }
private static Map < Integer , AtomicLong > createEmptySendgraphMap ( ) { return new HashMap < Integer , AtomicLong > ( ) { @ Override public AtomicLong get ( Object key ) { AtomicLong result = super . get ( key ) ; if ( result == null ) { result = new AtomicLong ( ) ; put ( ( Integer ) key , result ) ; } return result ; } @ Override public String toString ( ) { StringBuilder sb = new StringBuilder ( ) ; for ( Map . Entry < Integer , AtomicLong > entry : entrySet ( ) ) { if ( sb . length ( ) > 0 ) { sb . append ( " " ) ; } sb . append ( entry . getKey ( ) ) . append ( ":" ) . append ( entry . getValue ( ) . get ( ) ) ; } return sb . toString ( ) ; } } ; }
Create an empty sendgraph map which will return 0L values for each non-existing entry.
Create an empty sendgraph map which will return 0L values for each non - existing entry .