当前位置: 首页>>代码示例>>Java>>正文


Java EdgeReader.initialize方法代码示例

本文整理汇总了Java中org.apache.giraph.io.EdgeReader.initialize方法的典型用法代码示例。如果您正苦于以下问题:Java EdgeReader.initialize方法的具体用法?Java EdgeReader.initialize怎么用?Java EdgeReader.initialize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.giraph.io.EdgeReader的用法示例。


在下文中一共展示了EdgeReader.initialize方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testInputParserWithDefaultWeight

import org.apache.giraph.io.EdgeReader; //导入方法依赖的package包/类
@Test
public void testInputParserWithDefaultWeight() throws IOException, InterruptedException {
    String input = "1,2";
    when(rr.getCurrentValue()).thenReturn(new Text(input));
    EdgeReader ter = createEdgeReader(rr);
    ter.setConf(conf);
    ter.initialize(null, tac);
    assertEquals(ter.getCurrentSourceId(), new Text("1"));
    assertEquals(ter.getCurrentEdge().getTargetVertexId(), new Text("2"));
    assertEquals(ter.getCurrentEdge().getValue(), new Text(""));

}
 
开发者ID:Sotera,项目名称:distributed-graph-analytics,代码行数:13,代码来源:DGATextEdgeValueInputFormatTest.java

示例2: testInputParserWithDefaultWeightAndOverriddenSeparator

import org.apache.giraph.io.EdgeReader; //导入方法依赖的package包/类
@Test
public void testInputParserWithDefaultWeightAndOverriddenSeparator() throws IOException, InterruptedException {
    String input = "1\t2";
    when(rr.getCurrentValue()).thenReturn(new Text(input));
    EdgeReader ter = createEdgeReader(rr);
    conf.set(LINE_TOKENIZE_VALUE, "\t");
    ter.setConf(conf);
    ter.initialize(null, tac);
    assertEquals(ter.getCurrentSourceId(), new Text("1"));
    assertEquals(ter.getCurrentEdge().getTargetVertexId(), new Text("2"));
    assertEquals(ter.getCurrentEdge().getValue(), new Text());

}
 
开发者ID:Sotera,项目名称:distributed-graph-analytics,代码行数:14,代码来源:DGATextEdgeValueInputFormatTest.java

示例3: testInputParserWithCustomWeight

import org.apache.giraph.io.EdgeReader; //导入方法依赖的package包/类
@Test
public void testInputParserWithCustomWeight() throws IOException, InterruptedException {
    String input = "1,2,10";
    when(rr.getCurrentValue()).thenReturn(new Text(input));
    EdgeReader ter = createEdgeReader(rr);
    ter.setConf(conf);
    ter.initialize(null, tac);
    assertEquals(ter.getCurrentSourceId(), new Text("1"));
    assertEquals(ter.getCurrentEdge().getTargetVertexId(), new Text("2"));
    assertEquals(ter.getCurrentEdge().getValue(), new Text("10"));

}
 
开发者ID:Sotera,项目名称:distributed-graph-analytics,代码行数:13,代码来源:DGATextEdgeValueInputFormatTest.java

示例4: testInputParserIgnoreWeight

import org.apache.giraph.io.EdgeReader; //导入方法依赖的package包/类
@Test
public void testInputParserIgnoreWeight() throws IOException, InterruptedException {
    String input = "1,2,10";
    conf.set(IO_IGNORE_THIRD, "true");
    when(rr.getCurrentValue()).thenReturn(new Text(input));
    EdgeReader ter = createEdgeReader(rr);
    ter.setConf(conf);
    ter.initialize(null, tac);
    assertEquals(ter.getCurrentSourceId(), new Text("1"));
    assertEquals(ter.getCurrentEdge().getTargetVertexId(), new Text("2"));
    assertEquals(ter.getCurrentEdge().getValue(), new Text(""));

}
 
开发者ID:Sotera,项目名称:distributed-graph-analytics,代码行数:14,代码来源:DGATextEdgeValueInputFormatTest.java

示例5: testInputParserWithCustomWeightAndOverriddenSeparator

import org.apache.giraph.io.EdgeReader; //导入方法依赖的package包/类
@Test
public void testInputParserWithCustomWeightAndOverriddenSeparator() throws IOException, InterruptedException {
    String input = "1\t2\t10";
    when(rr.getCurrentValue()).thenReturn(new Text(input));
    EdgeReader ter = createEdgeReader(rr);
    conf.set(LINE_TOKENIZE_VALUE, "\t");
    ter.setConf(conf);
    ter.initialize(null, tac);
    assertEquals(ter.getCurrentSourceId(), new Text("1"));
    assertEquals(ter.getCurrentEdge().getTargetVertexId(), new Text("2"));
    assertEquals(ter.getCurrentEdge().getValue(), new Text("10"));

}
 
开发者ID:Sotera,项目名称:distributed-graph-analytics,代码行数:14,代码来源:DGATextEdgeValueInputFormatTest.java

示例6: testInputParserWithDelimiterInData

import org.apache.giraph.io.EdgeReader; //导入方法依赖的package包/类
@Test
public void testInputParserWithDelimiterInData() throws IOException, InterruptedException {
    String input = "te\\[email protected]\[email protected]\t10";
    when(rr.getCurrentValue()).thenReturn(new Text(input));
    EdgeReader ter = createEdgeReader(rr);
    conf.set(LINE_TOKENIZE_VALUE, "\t");
    ter.setConf(conf);
    ter.initialize(null, tac);
    assertEquals(ter.getCurrentSourceId(), new Text("te\\[email protected]"));
    assertEquals(ter.getCurrentEdge().getTargetVertexId(), new Text("[email protected]"));
    assertEquals(ter.getCurrentEdge().getValue(), new Text("10"));

}
 
开发者ID:Sotera,项目名称:distributed-graph-analytics,代码行数:14,代码来源:DGATextEdgeValueInputFormatTest.java

示例7: testInputParserWithDelimiterInDataNoEscape

import org.apache.giraph.io.EdgeReader; //导入方法依赖的package包/类
@Test
public void testInputParserWithDelimiterInDataNoEscape() throws IOException, InterruptedException {
    String input = "te\[email protected]\[email protected]\t10";
    when(rr.getCurrentValue()).thenReturn(new Text(input));
    EdgeReader ter = createEdgeReader(rr);
    conf.set(LINE_TOKENIZE_VALUE, "\t");
    ter.setConf(conf);
    ter.initialize(null, tac);
    assertEquals(ter.getCurrentSourceId(), new Text("te"));
    assertEquals(ter.getCurrentEdge().getTargetVertexId(), new Text("[email protected]"));
    assertEquals(ter.getCurrentEdge().getValue(), new Text("[email protected]"));

}
 
开发者ID:Sotera,项目名称:distributed-graph-analytics,代码行数:14,代码来源:DGATextEdgeValueInputFormatTest.java

示例8: testInputParserWithMalformedLine

import org.apache.giraph.io.EdgeReader; //导入方法依赖的package包/类
@Test(expected=IOException.class)
public void testInputParserWithMalformedLine() throws IOException, InterruptedException {
    String input = "1";
    when(rr.getCurrentValue()).thenReturn(new Text(input));
    EdgeReader ter = createEdgeReader(rr);
    ter.setConf(conf);
    ter.initialize(null, tac);
    assertEquals(ter.getCurrentSourceId(), new Text("1"));
    assertEquals(ter.getCurrentEdge().getTargetVertexId(), new Text());
    assertEquals(ter.getCurrentEdge().getValue(), new Text());

}
 
开发者ID:Sotera,项目名称:distributed-graph-analytics,代码行数:13,代码来源:DGATextEdgeValueInputFormatTest.java

示例9: testInputParserWithMalformedLineAndDelimiter

import org.apache.giraph.io.EdgeReader; //导入方法依赖的package包/类
@Test(expected=IOException.class)
public void testInputParserWithMalformedLineAndDelimiter() throws IOException, InterruptedException {
    String input = "1,";
    when(rr.getCurrentValue()).thenReturn(new Text(input));
    EdgeReader ter = createEdgeReader(rr);
    ter.setConf(conf);
    ter.initialize(null, tac);
    assertEquals(ter.getCurrentSourceId(), new Text("1"));
    assertEquals(ter.getCurrentEdge().getTargetVertexId(), new Text());
    assertEquals(ter.getCurrentEdge().getValue(), new Text());

}
 
开发者ID:Sotera,项目名称:distributed-graph-analytics,代码行数:13,代码来源:DGATextEdgeValueInputFormatTest.java

示例10: testInputParserWithMalformedLineAndDelimiterNoSource

import org.apache.giraph.io.EdgeReader; //导入方法依赖的package包/类
@Test(expected=IOException.class)
public void testInputParserWithMalformedLineAndDelimiterNoSource() throws IOException, InterruptedException {
    String input = ",1";
    when(rr.getCurrentValue()).thenReturn(new Text(input));
    EdgeReader ter = createEdgeReader(rr);
    ter.setConf(conf);
    ter.initialize(null, tac);
    assertEquals(ter.getCurrentSourceId(), new Text());
    assertEquals(ter.getCurrentEdge().getTargetVertexId(), new Text("1"));
    assertEquals(ter.getCurrentEdge().getValue(), new Text());

}
 
开发者ID:Sotera,项目名称:distributed-graph-analytics,代码行数:13,代码来源:DGATextEdgeValueInputFormatTest.java

示例11: testInputParserWithDefaultWeight

import org.apache.giraph.io.EdgeReader; //导入方法依赖的package包/类
@Test
public void testInputParserWithDefaultWeight() throws IOException, InterruptedException {
    String input = "1,2";
    when(rr.getCurrentValue()).thenReturn(new Text(input));
    EdgeReader ter = createEdgeReader(rr);
    ter.setConf(conf);
    ter.initialize(null, tac);
    assertEquals(ter.getCurrentSourceId(), new Text("1"));
    assertEquals(ter.getCurrentEdge().getTargetVertexId(), new Text("2"));
    assertEquals(ter.getCurrentEdge().getValue(), new LongWritable(1L));

}
 
开发者ID:Sotera,项目名称:distributed-graph-analytics,代码行数:13,代码来源:DGALongEdgeValueInputFormatTest.java

示例12: testInputParserWithDefaultWeightAndOverriddenSeparator

import org.apache.giraph.io.EdgeReader; //导入方法依赖的package包/类
@Test
public void testInputParserWithDefaultWeightAndOverriddenSeparator() throws IOException, InterruptedException {
    String input = "1\t2";
    when(rr.getCurrentValue()).thenReturn(new Text(input));
    EdgeReader ter = createEdgeReader(rr);
    conf.set(LINE_TOKENIZE_VALUE, "\t");
    ter.setConf(conf);
    ter.initialize(null, tac);
    assertEquals(ter.getCurrentSourceId(), new Text("1"));
    assertEquals(ter.getCurrentEdge().getTargetVertexId(), new Text("2"));
    assertEquals(ter.getCurrentEdge().getValue(), new LongWritable(1L));

}
 
开发者ID:Sotera,项目名称:distributed-graph-analytics,代码行数:14,代码来源:DGALongEdgeValueInputFormatTest.java

示例13: testInputParserWithCustomWeight

import org.apache.giraph.io.EdgeReader; //导入方法依赖的package包/类
@Test
public void testInputParserWithCustomWeight() throws IOException, InterruptedException {
    String input = "1,2,10";
    when(rr.getCurrentValue()).thenReturn(new Text(input));
    EdgeReader ter = createEdgeReader(rr);
    ter.setConf(conf);
    ter.initialize(null, tac);
    assertEquals(ter.getCurrentSourceId(), new Text("1"));
    assertEquals(ter.getCurrentEdge().getTargetVertexId(), new Text("2"));
    assertEquals(ter.getCurrentEdge().getValue(), new LongWritable(10L));

}
 
开发者ID:Sotera,项目名称:distributed-graph-analytics,代码行数:13,代码来源:DGALongEdgeValueInputFormatTest.java

示例14: testInputParserWithCustomWeightAndOverriddenSeparator

import org.apache.giraph.io.EdgeReader; //导入方法依赖的package包/类
@Test
public void testInputParserWithCustomWeightAndOverriddenSeparator() throws IOException, InterruptedException {
    String input = "1\t2\t10";
    when(rr.getCurrentValue()).thenReturn(new Text(input));
    EdgeReader ter = createEdgeReader(rr);
    conf.set(LINE_TOKENIZE_VALUE, "\t");
    ter.setConf(conf);
    ter.initialize(null, tac);
    assertEquals(ter.getCurrentSourceId(), new Text("1"));
    assertEquals(ter.getCurrentEdge().getTargetVertexId(), new Text("2"));
    assertEquals(ter.getCurrentEdge().getValue(), new LongWritable(10L));

}
 
开发者ID:Sotera,项目名称:distributed-graph-analytics,代码行数:14,代码来源:DGALongEdgeValueInputFormatTest.java

示例15: testInputParserWithDelimiterInData

import org.apache.giraph.io.EdgeReader; //导入方法依赖的package包/类
@Test
public void testInputParserWithDelimiterInData() throws IOException, InterruptedException {
    String input = "te\\[email protected]\[email protected]\t10";
    when(rr.getCurrentValue()).thenReturn(new Text(input));
    EdgeReader ter = createEdgeReader(rr);
    conf.set(LINE_TOKENIZE_VALUE, "\t");
    ter.setConf(conf);
    ter.initialize(null, tac);
    assertEquals(ter.getCurrentSourceId(), new Text("te\\[email protected]"));
    assertEquals(ter.getCurrentEdge().getTargetVertexId(), new Text("[email protected]"));
    assertEquals(ter.getCurrentEdge().getValue(), new LongWritable(10L));

}
 
开发者ID:Sotera,项目名称:distributed-graph-analytics,代码行数:14,代码来源:DGALongEdgeValueInputFormatTest.java


注:本文中的org.apache.giraph.io.EdgeReader.initialize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。