DomainSocket implements Closeable { public static String getEffectivePath(String path, int port) { return path.replace("_PORT", String.valueOf(port)); } private  DomainSocket(String path, int fd); static String getLoadingFailureReason(); @VisibleForTesting static void disableBindPathValidation(); static String getEffectivePath(String path, int port); static DomainSocket bindAndListen(String path); static DomainSocket[] socketpair(); DomainSocket accept(); static DomainSocket connect(String path); boolean isOpen(); String getPath(); DomainInputStream getInputStream(); DomainOutputStream getOutputStream(); DomainChannel getChannel(); void setAttribute(int type, int size); int getAttribute(int type); @Override void close(); void shutdown(); void sendFileDescriptors(FileDescriptor descriptors[],
      byte jbuf[], int offset, int length); int recvFileInputStreams(FileInputStream[] streams, byte buf[],
        int offset, int length); @Override String toString(); static final int SEND_BUFFER_SIZE; static final int RECEIVE_BUFFER_SIZE; static final int SEND_TIMEOUT; static final int RECEIVE_TIMEOUT; }
@Test(timeout=180000) public void testSocketPathSetGet() throws IOException { Assert.assertEquals("/var/run/hdfs/sock.100", DomainSocket.getEffectivePath("/var/run/hdfs/sock._PORT", 100)); }