Package org.apache.flink.core.io

Examples of org.apache.flink.core.io.StringRecord


   * This test checks the channel selection
   */
  @Test
  public void channelSelect() {

    final StringRecord dummyRecord = new StringRecord("abc");
    final RoundRobinChannelSelector<StringRecord> selector = new RoundRobinChannelSelector<StringRecord>();
    // Test with two channels
    final int numberOfOutputChannels = 2;
    int[] selectedChannels = selector.selectChannels(dummyRecord, numberOfOutputChannels);
    assertEquals(1, selectedChannels.length);
View Full Code Here


   * Tests the serialization/deserialization of the {@link StringRecord} class.
   */
  @Test
  public void testStringRecord() {

    final StringRecord orig = new StringRecord("Test Record");

    try {

      final StringRecord copy = (StringRecord) CommonTestUtils.createCopyWritable(orig);
     
      assertEquals(orig.getLength(), copy.getLength());
      assertEquals(orig.toString(), copy.toString());
      assertEquals(orig, copy);
      assertEquals(orig.hashCode(), copy.hashCode());

    } catch (IOException ioe) {
      fail(ioe.getMessage());
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.flink.core.io.StringRecord

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.