Package org.hibernate.shards

Examples of org.hibernate.shards.ShardId


  }

  public static Unary<Integer, ShardId> nodeIdToShardIdConverter() {
    return new Unary<Integer, ShardId>() {
      public ShardId f(Integer id) {
        return new ShardId(id);
      }
    };
  }
View Full Code Here


    ConfigurationReader reader = new ConfigurationReader(Continent.class, WeatherReport.class);
    Hive hive = getHive();
    HiveShardSelector selector = new HiveShardSelector(reader.getHiveConfiguration(), hive);
    WeatherReport report = WeatherReportImpl.generate();

    ShardId id = selector.selectShardIdForNewObject(report);
    Assert.assertNotNull(id);

    Collection<Integer> nodeIds = Transform.map(new Unary<Node, Integer>() {
      public Integer f(Node n) {
        return n.getId();
      }
    }, hive.getNodes());

    assertTrue(Filter.grepItemAgainstList(new Integer(id.getId()), nodeIds));
  }
View Full Code Here

TOP

Related Classes of org.hibernate.shards.ShardId

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.