org.apache.hadoop.ipc.ProtocolSignature Java Examples

The following examples show how to use org.apache.hadoop.ipc.ProtocolSignature. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ProxyJobTracker.java    From RDFS with Apache License 2.0 5 votes vote down vote up
@Override
public ProtocolSignature getProtocolSignature(
  String protocol,
  long clientVersion,
  int clientMethodsHash) throws IOException {
  return ProtocolSignature.getProtocolSignature(
    this, protocol, clientVersion, clientMethodsHash);
}
 
Example #2
Source File: TraceAdminProtocolServerSideTranslatorPB.java    From hadoop with Apache License 2.0 5 votes vote down vote up
@Override
public ProtocolSignature getProtocolSignature(String protocol,
        long clientVersion, int clientMethodsHash) throws IOException {
  if (!protocol.equals(RPC.getProtocolName(TraceAdminProtocolPB.class))) {
    throw new IOException("Serverside implements " +
        RPC.getProtocolName(TraceAdminProtocolPB.class) +
        ". The following requested protocol is unknown: " + protocol);
  }
  return ProtocolSignature.getProtocolSignature(clientMethodsHash,
      RPC.getProtocolVersion(TraceAdminProtocolPB.class),
      TraceAdminProtocolPB.class);
}
 
Example #3
Source File: TestDFSClientUpdateNameNodeSignature.java    From RDFS with Apache License 2.0 5 votes vote down vote up
/**
 * This function tests the method signature fingerprint passed back from
 * name-node with MetaInfo is correct.
 */
@SuppressWarnings("unchecked")
public void testNameNodeFingerprintSent() throws IOException {
  InetSocketAddress addr = cluster.getNameNode().getNameNodeDNAddress();
  DFSClient client = new DFSClient(addr, cluster.getNameNode().getConf());

  client.namenode.create("/testNameNodeFingerprintSent.txt", FsPermission
      .getDefault(), client.getClientName(), true, (short)1, 65535L);

  
  Class<? extends VersionedProtocol> inter;
  try {
    inter = (Class<? extends VersionedProtocol>)Class.forName(ClientProtocol.class.getName());
  } catch (Exception e) {
    throw new IOException(e);
  }
  long serverVersion = ClientProtocol.versionID;
  int serverFpFromNn = ProtocolSignature.getFingerprint(ProtocolSignature.getProtocolSignature(
      0, serverVersion, inter).getMethods());
  
  LocatedBlockWithMetaInfo loc = client.namenode.addBlockAndFetchMetaInfo("/testNameNodeFingerprintSent.txt",
      client.getClientName(), null, 0L);
  
  int serverFp = loc.getMethodFingerPrint();
  TestCase.assertEquals(serverFpFromNn, serverFp);    

  FileSystem fs = cluster.getFileSystem();
  Path f = new Path("/testNameNodeFingerprintSent1.txt");
  DataOutputStream a_out = fs.create(f);
  a_out.writeBytes("something");
  a_out.close();
  
  LocatedBlocksWithMetaInfo locs = client.namenode.openAndFetchMetaInfo("/testNameNodeFingerprintSent.txt",
      0L, 0L);
  TestCase.assertEquals(locs.getMethodFingerPrint(), serverFp);    
}
 
Example #4
Source File: TraceAdminProtocolServerSideTranslatorPB.java    From big-c with Apache License 2.0 5 votes vote down vote up
@Override
public ProtocolSignature getProtocolSignature(String protocol,
        long clientVersion, int clientMethodsHash) throws IOException {
  if (!protocol.equals(RPC.getProtocolName(TraceAdminProtocolPB.class))) {
    throw new IOException("Serverside implements " +
        RPC.getProtocolName(TraceAdminProtocolPB.class) +
        ". The following requested protocol is unknown: " + protocol);
  }
  return ProtocolSignature.getProtocolSignature(clientMethodsHash,
      RPC.getProtocolVersion(TraceAdminProtocolPB.class),
      TraceAdminProtocolPB.class);
}
 
Example #5
Source File: ZKFCProtocolServerSideTranslatorPB.java    From big-c with Apache License 2.0 5 votes vote down vote up
@Override
public ProtocolSignature getProtocolSignature(String protocol,
    long clientVersion, int clientMethodsHash) throws IOException {
  if (!protocol.equals(RPC.getProtocolName(ZKFCProtocolPB.class))) {
    throw new IOException("Serverside implements " +
        RPC.getProtocolName(ZKFCProtocolPB.class) +
        ". The following requested protocol is unknown: " + protocol);
  }

  return ProtocolSignature.getProtocolSignature(clientMethodsHash,
      RPC.getProtocolVersion(ZKFCProtocolPB.class),
      HAServiceProtocolPB.class);
}
 
Example #6
Source File: HAServiceProtocolServerSideTranslatorPB.java    From big-c with Apache License 2.0 5 votes vote down vote up
@Override
public ProtocolSignature getProtocolSignature(String protocol,
    long clientVersion, int clientMethodsHash) throws IOException {
  if (!protocol.equals(RPC.getProtocolName(HAServiceProtocolPB.class))) {
    throw new IOException("Serverside implements " +
        RPC.getProtocolName(HAServiceProtocolPB.class) +
        ". The following requested protocol is unknown: " + protocol);
  }

  return ProtocolSignature.getProtocolSignature(clientMethodsHash,
      RPC.getProtocolVersion(HAServiceProtocolPB.class),
      HAServiceProtocolPB.class);
}
 
Example #7
Source File: ZKFCProtocolServerSideTranslatorPB.java    From hadoop with Apache License 2.0 5 votes vote down vote up
@Override
public ProtocolSignature getProtocolSignature(String protocol,
    long clientVersion, int clientMethodsHash) throws IOException {
  if (!protocol.equals(RPC.getProtocolName(ZKFCProtocolPB.class))) {
    throw new IOException("Serverside implements " +
        RPC.getProtocolName(ZKFCProtocolPB.class) +
        ". The following requested protocol is unknown: " + protocol);
  }

  return ProtocolSignature.getProtocolSignature(clientMethodsHash,
      RPC.getProtocolVersion(ZKFCProtocolPB.class),
      HAServiceProtocolPB.class);
}
 
Example #8
Source File: HAServiceProtocolServerSideTranslatorPB.java    From hadoop with Apache License 2.0 5 votes vote down vote up
@Override
public ProtocolSignature getProtocolSignature(String protocol,
    long clientVersion, int clientMethodsHash) throws IOException {
  if (!protocol.equals(RPC.getProtocolName(HAServiceProtocolPB.class))) {
    throw new IOException("Serverside implements " +
        RPC.getProtocolName(HAServiceProtocolPB.class) +
        ". The following requested protocol is unknown: " + protocol);
  }

  return ProtocolSignature.getProtocolSignature(clientMethodsHash,
      RPC.getProtocolVersion(HAServiceProtocolPB.class),
      HAServiceProtocolPB.class);
}
 
Example #9
Source File: DistributedAvatarFileSystem.java    From RDFS with Apache License 2.0 5 votes vote down vote up
@Override
public ProtocolSignature getProtocolSignature(final String protocol,
    final long clientVersion, final int clientMethodsHash) throws IOException {
  return (new ImmutableFSCaller<ProtocolSignature>() {

    @Override
    ProtocolSignature call() throws IOException {
      return namenode.getProtocolSignature(
          protocol, clientVersion, clientMethodsHash);
    }

  }).callFS();
}
 
Example #10
Source File: TestDFSClientRetries.java    From RDFS with Apache License 2.0 4 votes vote down vote up
public ProtocolSignature getProtocolSignature(String protocol,
    long clientVersion, int clientMethodsHash) throws IOException {
  return ProtocolSignature.getProtocolSignature(
      this, protocol, clientVersion, clientMethodsHash);
}
 
Example #11
Source File: CoronaTaskTracker.java    From RDFS with Apache License 2.0 4 votes vote down vote up
@Override
public ProtocolSignature getProtocolSignature(String protocol,
    long clientVersion, int clientMethodsHash) throws IOException {
  return ProtocolSignature.getProtocolSignature(this, protocol,
      clientVersion, clientMethodsHash);
}
 
Example #12
Source File: RaidNode.java    From RDFS with Apache License 2.0 4 votes vote down vote up
@Override
public ProtocolSignature getProtocolSignature(String protocol,
		long clientVersion, int clientMethodsHash) throws IOException {
	return ProtocolSignature.getProtocolSignature(this, protocol,
			clientVersion, clientMethodsHash);
}
 
Example #13
Source File: DynamicCloudsDaemon.java    From RDFS with Apache License 2.0 4 votes vote down vote up
@Override
public ProtocolSignature getProtocolSignature(String protocol,
    long clientVersion, int clientMethodsHash) throws IOException {
  return ProtocolSignature.getProtocolSignature(
      this, protocol, clientVersion, clientMethodsHash);
}
 
Example #14
Source File: DatanodeProtocols.java    From RDFS with Apache License 2.0 4 votes vote down vote up
@Override
public ProtocolSignature getProtocolSignature(String protocol,
    long clientVersion, int clientMethodsHash) throws IOException {
  return ProtocolSignature.getProtocolSignature(
      this, protocol, clientVersion, clientMethodsHash);
}
 
Example #15
Source File: TaskTracker.java    From RDFS with Apache License 2.0 4 votes vote down vote up
public ProtocolSignature getProtocolSignature(String protocol,
    long clientVersion, int clientMethodsHash) throws IOException {
  return ProtocolSignature.getProtocolSignature(
      this, protocol, clientVersion, clientMethodsHash);
}
 
Example #16
Source File: LocalJobRunner.java    From RDFS with Apache License 2.0 4 votes vote down vote up
public ProtocolSignature getProtocolSignature(String protocol,
    long clientVersion, int clientMethodsHash) throws IOException {
  return ProtocolSignature.getProtocolSignature(
      this, protocol, clientVersion, clientMethodsHash);
}
 
Example #17
Source File: LocalJobRunner.java    From RDFS with Apache License 2.0 4 votes vote down vote up
public ProtocolSignature getProtocolSignature(String protocol,
    long clientVersion, int clientMethodsHash) throws IOException {
  return ProtocolSignature.getProtocolSignature(
      this, protocol, clientVersion, clientMethodsHash);
}
 
Example #18
Source File: JobTracker.java    From RDFS with Apache License 2.0 4 votes vote down vote up
public ProtocolSignature getProtocolSignature(String protocol,
    long clientVersion, int clientMethodsHash) throws IOException {
  return ProtocolSignature.getProtocolSignature(
      this, protocol, clientVersion, clientMethodsHash);
}
 
Example #19
Source File: RemoteJTProxy.java    From RDFS with Apache License 2.0 4 votes vote down vote up
@Override
public ProtocolSignature getProtocolSignature(String protocol,
    long clientVersion, int clientMethodsHash) throws IOException {
  return ProtocolSignature.getProtocolSignature(
      this, protocol, clientVersion, clientMethodsHash);
}
 
Example #20
Source File: CoronaJobTracker.java    From RDFS with Apache License 2.0 4 votes vote down vote up
@Override
public ProtocolSignature getProtocolSignature(String protocol,
    long clientVersion, int clientMethodsHash) throws IOException {
  return ProtocolSignature.getProtocolSignature(
      this, protocol, clientVersion, clientMethodsHash);
}
 
Example #21
Source File: StramLocalCluster.java    From attic-apex-core with Apache License 2.0 4 votes vote down vote up
@Override
public ProtocolSignature getProtocolSignature(String protocol, long clientVersion, int clientMethodsHash) throws IOException
{
  throw new UnsupportedOperationException("not implemented in local mode");
}
 
Example #22
Source File: UtilizationCollector.java    From RDFS with Apache License 2.0 4 votes vote down vote up
@Override
public ProtocolSignature getProtocolSignature(String protocol,
    long clientVersion, int clientMethodsHash) throws IOException {
  return ProtocolSignature.getProtocolSignature(
      this, protocol, clientVersion, clientMethodsHash);
}
 
Example #23
Source File: UtilizationCollectorCached.java    From RDFS with Apache License 2.0 4 votes vote down vote up
@Override
public ProtocolSignature getProtocolSignature(String protocol,
    long clientVersion, int clientMethodsHash) throws IOException {
  return ProtocolSignature.getProtocolSignature(
      this, protocol, clientVersion, clientMethodsHash);
}
 
Example #24
Source File: FairScheduler.java    From RDFS with Apache License 2.0 4 votes vote down vote up
@Override
public ProtocolSignature getProtocolSignature(String protocol,
    long clientVersion, int clientMethodsHash) throws IOException {
  return ProtocolSignature.getProtocolSignature(
      this, protocol, clientVersion, clientMethodsHash);
}
 
Example #25
Source File: DataNode.java    From RDFS with Apache License 2.0 4 votes vote down vote up
public ProtocolSignature getProtocolSignature(String protocol,
    long clientVersion, int clientMethodsHash) throws IOException {
  return ProtocolSignature.getProtocolSignature(
      this, protocol, clientVersion, clientMethodsHash);
}
 
Example #26
Source File: YARNRunner.java    From incubator-tez with Apache License 2.0 4 votes vote down vote up
@Override
public ProtocolSignature getProtocolSignature(String protocol,
    long clientVersion, int clientMethodsHash) throws IOException {
  return ProtocolSignature.getProtocolSignature(this, protocol, clientVersion,
      clientMethodsHash);
}
 
Example #27
Source File: TaskAttemptListenerImpTezDag.java    From incubator-tez with Apache License 2.0 4 votes vote down vote up
@Override
public ProtocolSignature getProtocolSignature(String protocol,
    long clientVersion, int clientMethodsHash) throws IOException {
  return ProtocolSignature.getProtocolSignature(this, protocol,
      clientVersion, clientMethodsHash);
}
 
Example #28
Source File: TestTaskExecution.java    From incubator-tez with Apache License 2.0 4 votes vote down vote up
@Override
public ProtocolSignature getProtocolSignature(String protocol, long clientVersion,
    int clientMethodsHash) throws IOException {
  return null;
}
 
Example #29
Source File: YARNRunner.java    From tez with Apache License 2.0 4 votes vote down vote up
@Override
public ProtocolSignature getProtocolSignature(String protocol,
    long clientVersion, int clientMethodsHash) throws IOException {
  return ProtocolSignature.getProtocolSignature(this, protocol, clientVersion,
      clientMethodsHash);
}
 
Example #30
Source File: TezTaskCommunicatorImpl.java    From tez with Apache License 2.0 4 votes vote down vote up
@Override
public ProtocolSignature getProtocolSignature(String protocol, long clientVersion,
                                              int clientMethodsHash) throws IOException {
  return ProtocolSignature.getProtocolSignature(this, protocol,
      clientVersion, clientMethodsHash);
}