public static String[] getRackHostName(String hostname) {
    NodeBase node = new NodeBase(hostname);
    return new String[] {node.getNetworkLocation().substring(1),
        node.getName()};
  }
@Test
  public void testGetRackHostname() {
    String str = "/rack1/node1";
    String[] rackHostname = SLSUtils.getRackHostName(str);
    Assert.assertEquals("rack1", rackHostname[0]);
    Assert.assertEquals("node1", rackHostname[1]);

    str = "/rackA/rackB/node1";
    rackHostname = SLSUtils.getRackHostName(str);
    Assert.assertEquals("rackA/rackB", rackHostname[0]);
    Assert.assertEquals("node1", rackHostname[1]);
  }