Package com.ngdata.hbaseindexer.indexer

Examples of com.ngdata.hbaseindexer.indexer.SharderException


        Preconditions.checkArgument(numShards > 0, "There should be at least one shard");
        this.numShards = numShards;
        try {
            this.mdAlgorithm = MessageDigest.getInstance("MD5");
        } catch (NoSuchAlgorithmException e) {
            throw new SharderException("failed to initialize MD5 digest", e);
        }
    }
View Full Code Here


            // Cloning message digest rather than looking it up each time
            MessageDigest md = (MessageDigest) mdAlgorithm.clone();
            byte[] digest = md.digest(key.getBytes("UTF-8"));
            return ((digest[0] & 0xFF) << 8) + ((digest[1] & 0xFF));
        } catch (UnsupportedEncodingException e) {
            throw new SharderException("Error calculating hash.", e);
        } catch (CloneNotSupportedException e) {
            // Sun's MD5 supports cloning, so we don't expect this to happen
            throw new RuntimeException(e);
        }
    }
View Full Code Here

TOP

Related Classes of com.ngdata.hbaseindexer.indexer.SharderException

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.