Package com.senseidb.indexing.hadoop.keyvalueformat

Examples of com.senseidb.indexing.hadoop.keyvalueformat.Shard


        Arrays.sort(shardNames, 0, count);

        Shard[] shards = new Shard[count >= numShards ? count : numShards];
        for (int i = 0; i < count; i++) {
          shards[i] =
              new Shard(versionNumber, parent + shardNames[i], generation);
        }

        int number = count;
        for (int i = count; i < numShards; i++) {
          String shardPath;
          while (true) {
            shardPath = parent + indexSubDirPrefix + NUMBER_FORMAT.format(number++);
            if (!fs.exists(new Path(shardPath))) {
              break;
            }
          }
          shards[i] = new Shard(versionNumber, shardPath, generation);
        }
        return shards;
      } else {
        Shard[] shards = new Shard[numShards];
        for (int i = 0; i < shards.length; i++) {
          shards[i] =
              new Shard(versionNumber, parent + indexSubDirPrefix + NUMBER_FORMAT.format(i),
                  generation);
        }
        return shards;
      }
    }
View Full Code Here


          }

          if (generation != shards[i].getGeneration()) {
            // set the starting generation for the shard
            shards[i] =
                new Shard(shards[i].getVersion(), shards[i].getDirectory(),
                    generation);
          }
        }
      }
View Full Code Here

TOP

Related Classes of com.senseidb.indexing.hadoop.keyvalueformat.Shard

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.