Example usage for java.util ConcurrentModificationException toString

List of usage examples for java.util ConcurrentModificationException toString

Introduction

In this page you can find the example usage for java.util ConcurrentModificationException toString.

Prototype

public String toString() 

Source Link

Document

Returns a short description of this throwable.

Usage

From source file:org.apache.hadoop.hbase.MultiRegionTable.java

private static void compact(final MiniHBaseCluster cluster, final HRegionInfo r) throws IOException {

    LOG.info("Starting compaction");
    for (MiniHBaseCluster.RegionServerThread thread : cluster.regionThreads) {
        SortedMap<Text, HRegion> regions = thread.getRegionServer().onlineRegions;

        // Retry if ConcurrentModification... alternative of sync'ing is not
        // worth it for sake of unit test.

        for (int i = 0; i < 10; i++) {
            try {
                for (HRegion online : regions.values()) {
                    if (online.getRegionName().toString().equals(r.getRegionName().toString())) {
                        online.compactStores();
                    }//  w  ww.j  a v a 2 s . c o  m
                }
                break;
            } catch (ConcurrentModificationException e) {
                LOG.warn("Retrying because ..." + e.toString() + " -- one or " + "two should be fine");
                continue;
            }
        }
    }
}