Esempio n. 1
0
 public static Collection<Bucket> getBuckets(MapWritable key) {
   Collection<Bucket> bucketList = new ArrayList<Bucket>();
   MapWritable bucketMap = (MapWritable) key.get(MAPWRITABLE_BUCKET_KEY);
   for (Writable w : bucketMap.values()) {
     bucketList.add((Bucket) w);
   }
   return bucketList;
 }
Esempio n. 2
0
  public MapWritable getBucketAsKey(BucketStripped bucketStripped) throws IOException {
    MapWritable mw = new MapWritable();
    MapWritable bucketMap = new MapWritable();

    Bucket bucket = getBucket(bucketStripped);
    bucketMap.put(new IntWritable(bucket.hashCode()), bucket);
    mw.put(MAPWRITABLE_BUCKET_KEY, bucketMap);
    return mw;
  }
Esempio n. 3
0
  public MapWritable toMapWritableKey() {
    MapWritable mw = new MapWritable();
    MapWritable bucketMap = new MapWritable();

    for (IntWritable key : bucketCache.keySet()) {
      bucketMap.put(key, bucketCache.get(key));
    }
    mw.put(MAPWRITABLE_BUCKET_KEY, bucketMap);

    return mw;
  }