本文整理匯總了Java中org.apache.tajo.master.querymaster.Repartitioner類的典型用法代碼示例。如果您正苦於以下問題:Java Repartitioner類的具體用法?Java Repartitioner怎麽用?Java Repartitioner使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
Repartitioner類屬於org.apache.tajo.master.querymaster包,在下文中一共展示了Repartitioner類的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: testCreateHashFetchURL
import org.apache.tajo.master.querymaster.Repartitioner; //導入依賴的package包/類
@Test
public void testCreateHashFetchURL() throws Exception {
QueryId q1 = TestTajoIds.createQueryId(1315890136000l, 2);
String hostName = "tajo1";
int port = 1234;
ExecutionBlockId sid = new ExecutionBlockId(q1, 2);
int partitionId = 2;
List<QueryUnit.IntermediateEntry> intermediateEntries = TUtil.newList();
for (int i = 0; i < 1000; i++) {
intermediateEntries.add(new QueryUnit.IntermediateEntry(i, 0, partitionId, hostName, port));
}
Collection<URI> uris = Repartitioner.
createHashFetchURL(hostName + ":" + port, sid, partitionId,
TajoWorkerProtocol.ShuffleType.HASH_SHUFFLE, intermediateEntries);
List<String> taList = TUtil.newList();
for (URI uri : uris) {
final Map<String, List<String>> params =
new QueryStringDecoder(uri).getParameters();
taList.addAll(splitMaps(params.get("ta")));
}
int checkTaskId = 0;
for (String ta : taList) {
assertEquals(checkTaskId++, Integer.parseInt(ta.split("_")[0]));
}
}