Package java.util.zip

Examples of java.util.zip.CRC32.update()


    if (rtn == null) {
      StringBuffer buff=new StringBuffer();
      buff.append(this.getClass().getName()).append("_");
      buff.append(this.dir_uuid).append("_");
    CRC32 crc32 = new CRC32();
    crc32.update(0);
    long filesize=0;
      if(filelist!=null)
      {
        buff.append(filelist.length).append("_");
        for(String s:filelist)
View Full Code Here


      if(filelist!=null)
      {
        buff.append(filelist.length).append("_");
        for(String s:filelist)
        {
            crc32.update(new String(s).getBytes());
            try{
              filesize+=this.fileLength(s);
            }catch(Throwable e)
            {
              logger.error("filelength",e);
View Full Code Here

    if (rtn == null) {
    StringBuffer buff = new StringBuffer();
    buff.append(this.getClass().getName()).append("_");
    buff.append(this.directory.getAbsolutePath()).append("_");
    CRC32 crc32 = new CRC32();
    crc32.update(0);
    long filesize = 0;
    long filemodify = 0;

    if (filelist != null) {
      buff.append(filelist.length).append("_");
View Full Code Here

    long filemodify = 0;

    if (filelist != null) {
      buff.append(filelist.length).append("_");
      for (String s : filelist) {
        crc32.update(new String(s).getBytes());
        try {
          filesize += this.fileLength(s);
        } catch (Throwable e) {
          logger.error("filelength", e);
        }
View Full Code Here

     
      Double val=MdrillUtils.ParseDouble(ft.indexedToReadable(term.text()));
      tmValue=Double.doubleToLongBits(val);
    }else{
      CRC32 crc32 = new CRC32();
      crc32.update(new String(ft.indexedToReadable(term.text())).getBytes());
      tmValue=crc32.getValue();
    }
     

      docValues.collectTm(tmValue);
View Full Code Here

public class MdrillFunction {
  public static Long uuid()
  {
    CRC32 crc32 = new CRC32();
    crc32.update(String.valueOf(java.util.UUID.randomUUID().toString()).getBytes());
    return crc32.getValue();
  }
 
 
}
View Full Code Here

 


  public ShardScanner getShardScanner(short shard,String partion, byte[] last) throws IOException {
    CRC32 crc32 = new CRC32();
    crc32.update(partion.getBytes());
    return new ShardScanner(table.getConfiguration(), queueName, shard, crc32.getValue(),last);
  }

  public void close() throws IOException {
    table.close();
View Full Code Here

    public void startSyncFromHdfs(final Runnable callback) throws IOException
  {
      Configuration conf=params.getConf();
     
      CRC32 crc32 = new CRC32();
    crc32.update(String.valueOf(java.util.UUID.randomUUID().toString()).getBytes());
    Long uuid=crc32.getValue();
    String pathname=String.valueOf(fmt.format(new Date())+"_"+status.uniqIndex.incrementAndGet()) + "_"  + uuid;
     
      final Path localHdfsRecover=new Path(new Path(params.getIndexMalloc(pathname.hashCode()),"realtime_hdfs_recover"),pathname);
      final Path hdfsRealtime=new Path(params.hdfsPath,"realtime");
View Full Code Here

  private MessageID id;

  public static Message INSTANCE(short shard,String partion,byte[] value,Configuration realConf)
  {
    CRC32 crc32 = new CRC32();
    crc32.update(partion.getBytes());
    MessageID id=MessageID.INSTANCE(shard, crc32.getValue(), realConf);
    return new Message( id, value);
  }

  private Message(MessageID id, byte[] value) {
View Full Code Here

    public void startSyncFromHdfs(final Runnable callback) throws IOException
  {
      Configuration conf=params.getConf();
     
      CRC32 crc32 = new CRC32();
    crc32.update(String.valueOf(java.util.UUID.randomUUID().toString()).getBytes());
    Long uuid=crc32.getValue();
    String pathname=String.valueOf(fmt.format(new Date())+"_"+status.uniqIndex.incrementAndGet()) + "_"  + uuid;
     
      final Path localHdfsRecover=new Path(new Path(params.getIndexMalloc(pathname.hashCode()),"realtime_hdfs_recover"),pathname);
      final Path hdfsRealtime=new Path(params.hdfsPath,"realtime");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.