Examples of NetAddress


Examples of netP5.NetAddress

        return port;
    }


    public NetAddress netAddress() {
        return new NetAddress(inetAddress, port);
    }
View Full Code Here

Examples of netP5.NetAddress

     * @deprecated
     * @invisible
     * @return NetAddress
     */
    public NetAddress netaddress() {
        return new NetAddress(inetAddress, port);
    }
View Full Code Here

Examples of netP5.NetAddress

   * @param theAddress String
   * @param thePort int
   * @deprecated
   */
  public static void flush(final byte[] theBytes, final String theAddress, final int thePort) {
    flush(theBytes, new NetAddress(theAddress, thePort));
  }
View Full Code Here

Examples of netP5.NetAddress

   * @param theAddress String
   * @param thePort int
   * @deprecated
   */
  public static void flush(final OscMessage theOscMessage, final String theAddress, final int thePort) {
    flush(theOscMessage.getBytes(), new NetAddress(theAddress, thePort));
  }
View Full Code Here

Examples of tachyon.thrift.NetAddress

          try {
            resolvedHost = NetworkUtils.resolveHostName(loc);
          } catch (UnknownHostException e) {
            resolvedHost = loc;
          }
          ret.add(new NetAddress(resolvedHost, -1, -1));
        }
      }
    }
    return ret;
  }
View Full Code Here

Examples of tachyon.thrift.NetAddress

  public TachyonWorker getWorker() {
    return mWorker;
  }

  public NetAddress getWorkerAddress() {
    return new NetAddress(mLocalhostName, getWorkerPort(), getWorkerDataPort());
  }
View Full Code Here

Examples of tachyon.thrift.NetAddress

  @Test
  public void getFqdnHostTest() throws UnknownHostException {
    Assert.assertEquals(NetworkUtils.getFqdnHost(new InetSocketAddress("localhost", 0)),
        "localhost");
    Assert.assertEquals(NetworkUtils.getFqdnHost(new NetAddress("localhost", 0, 0)), "localhost");
  }
View Full Code Here

Examples of tachyon.thrift.NetAddress

  @Test
  public void generateClientBlockInfoTest() {
    BlockInfo tInfo =
        new BlockInfo(new InodeFile("t", 100, 0, Constants.DEFAULT_BLOCK_SIZE_BYTE,
            System.currentTimeMillis()), 300, 800);
    tInfo.addLocation(15, new NetAddress("abc", 1, 11));
    tInfo.addLocation(22, new NetAddress("def", 2, 21));
    tInfo.addLocation(29, new NetAddress("gh", 3, 31));
    ClientBlockInfo clientBlockInfo = tInfo.generateClientBlockInfo();
    Assert.assertEquals((long) Constants.DEFAULT_BLOCK_SIZE_BYTE * 300, clientBlockInfo.offset);
    Assert.assertEquals(800, clientBlockInfo.length);
    Assert.assertEquals(3, clientBlockInfo.locations.size());
  }
View Full Code Here

Examples of tachyon.thrift.NetAddress

  @Test
  public void localtionTest() {
    BlockInfo tInfo =
        new BlockInfo(new InodeFile("t", 100, 0, Constants.DEFAULT_BLOCK_SIZE_BYTE,
            System.currentTimeMillis()), 300, 800);
    tInfo.addLocation(15, new NetAddress("abc", 1, 11));
    Assert.assertEquals(1, tInfo.getLocations().size());
    tInfo.addLocation(22, new NetAddress("def", 2, 21));
    Assert.assertEquals(2, tInfo.getLocations().size());
    tInfo.addLocation(29, new NetAddress("gh", 3, 31));
    Assert.assertEquals(3, tInfo.getLocations().size());
    tInfo.addLocation(15, new NetAddress("abc", 1, 11));
    Assert.assertEquals(3, tInfo.getLocations().size());
    tInfo.addLocation(22, new NetAddress("def", 2, 21));
    Assert.assertEquals(3, tInfo.getLocations().size());
    tInfo.addLocation(29, new NetAddress("gh", 3, 31));
    Assert.assertEquals(3, tInfo.getLocations().size());
    tInfo.removeLocation(15);
    Assert.assertEquals(2, tInfo.getLocations().size());
    tInfo.removeLocation(10);
    Assert.assertEquals(2, tInfo.getLocations().size());
View Full Code Here

Examples of tachyon.thrift.NetAddress

  @Test
  public void inMemoryLocationsTest() throws IOException, BlockInfoException {
    InodeFile inodeFile = new InodeFile("testFile1", 1, 0, 1000, System.currentTimeMillis());
    List<NetAddress> testAddresses = new ArrayList<NetAddress>(3);
    testAddresses.add(new NetAddress("testhost1", 1000, 1001));
    testAddresses.add(new NetAddress("testhost2", 2000, 2001));
    testAddresses.add(new NetAddress("testhost3", 3000, 3001));
    inodeFile.addBlock(new BlockInfo(inodeFile, 0, 5));
    inodeFile.addLocation(0, 1, testAddresses.get(0));
    Assert.assertEquals(1, inodeFile.getBlockLocations(0).size());
    inodeFile.addLocation(0, 2, testAddresses.get(1));
    Assert.assertEquals(2, inodeFile.getBlockLocations(0).size());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.