Java 类org.apache.hadoop.hdfs.qjournal.protocol.QJournalProtocol 实例源码

项目:hadoop    文件:IPCLoggerChannel.java   
protected QJournalProtocol createProxy() throws IOException {
  final Configuration confCopy = new Configuration(conf);

  // Need to set NODELAY or else batches larger than MTU can trigger 
  // 40ms nagling delays.
  confCopy.setBoolean(
      CommonConfigurationKeysPublic.IPC_CLIENT_TCPNODELAY_KEY,
      true);

  RPC.setProtocolEngine(confCopy,
      QJournalProtocolPB.class, ProtobufRpcEngine.class);
  return SecurityUtil.doAsLoginUser(
      new PrivilegedExceptionAction<QJournalProtocol>() {
        @Override
        public QJournalProtocol run() throws IOException {
          RPC.setProtocolEngine(confCopy,
              QJournalProtocolPB.class, ProtobufRpcEngine.class);
          QJournalProtocolPB pbproxy = RPC.getProxy(
              QJournalProtocolPB.class,
              RPC.getProtocolVersion(QJournalProtocolPB.class),
              addr, confCopy);
          return new QJournalProtocolTranslatorPB(pbproxy);
        }
      });
}
项目:hadoop    文件:TestQJMWithFaults.java   
@Override
protected QJournalProtocol createProxy() throws IOException {
  final QJournalProtocol realProxy = super.createProxy();
  QJournalProtocol mock = mockProxy(
      new WrapEveryCall<Object>(realProxy) {
        void beforeCall(InvocationOnMock invocation) throws Exception {
          rpcCount++;
          String callStr = "[" + addr + "] " + 
              invocation.getMethod().getName() + "(" +
              Joiner.on(", ").join(invocation.getArguments()) + ")";

          Callable<Void> inject = injections.get(rpcCount);
          if (inject != null) {
            LOG.info("Injecting code before IPC #" + rpcCount + ": " +
                callStr);
            inject.call();
          } else {
            LOG.info("IPC call #" + rpcCount + ": " + callStr);
          }
        }
      });
  return mock;
}
项目:aliyun-oss-hadoop-fs    文件:IPCLoggerChannel.java   
protected QJournalProtocol createProxy() throws IOException {
  final Configuration confCopy = new Configuration(conf);

  // Need to set NODELAY or else batches larger than MTU can trigger 
  // 40ms nagling delays.
  confCopy.setBoolean(
      CommonConfigurationKeysPublic.IPC_CLIENT_TCPNODELAY_KEY,
      true);

  RPC.setProtocolEngine(confCopy,
      QJournalProtocolPB.class, ProtobufRpcEngine.class);
  return SecurityUtil.doAsLoginUser(
      new PrivilegedExceptionAction<QJournalProtocol>() {
        @Override
        public QJournalProtocol run() throws IOException {
          RPC.setProtocolEngine(confCopy,
              QJournalProtocolPB.class, ProtobufRpcEngine.class);
          QJournalProtocolPB pbproxy = RPC.getProxy(
              QJournalProtocolPB.class,
              RPC.getProtocolVersion(QJournalProtocolPB.class),
              addr, confCopy);
          return new QJournalProtocolTranslatorPB(pbproxy);
        }
      });
}
项目:aliyun-oss-hadoop-fs    文件:TestQJMWithFaults.java   
@Override
protected QJournalProtocol createProxy() throws IOException {
  final QJournalProtocol realProxy = super.createProxy();
  QJournalProtocol mock = mockProxy(
      new WrapEveryCall<Object>(realProxy) {
        void beforeCall(InvocationOnMock invocation) throws Exception {
          rpcCount++;
          String callStr = "[" + addr + "] " + 
              invocation.getMethod().getName() + "(" +
              Joiner.on(", ").join(invocation.getArguments()) + ")";

          Callable<Void> inject = injections.get(rpcCount);
          if (inject != null) {
            LOG.info("Injecting code before IPC #" + rpcCount + ": " +
                callStr);
            inject.call();
          } else {
            LOG.info("IPC call #" + rpcCount + ": " + callStr);
          }
        }
      });
  return mock;
}
项目:big-c    文件:IPCLoggerChannel.java   
protected QJournalProtocol createProxy() throws IOException {
  final Configuration confCopy = new Configuration(conf);

  // Need to set NODELAY or else batches larger than MTU can trigger 
  // 40ms nagling delays.
  confCopy.setBoolean(
      CommonConfigurationKeysPublic.IPC_CLIENT_TCPNODELAY_KEY,
      true);

  RPC.setProtocolEngine(confCopy,
      QJournalProtocolPB.class, ProtobufRpcEngine.class);
  return SecurityUtil.doAsLoginUser(
      new PrivilegedExceptionAction<QJournalProtocol>() {
        @Override
        public QJournalProtocol run() throws IOException {
          RPC.setProtocolEngine(confCopy,
              QJournalProtocolPB.class, ProtobufRpcEngine.class);
          QJournalProtocolPB pbproxy = RPC.getProxy(
              QJournalProtocolPB.class,
              RPC.getProtocolVersion(QJournalProtocolPB.class),
              addr, confCopy);
          return new QJournalProtocolTranslatorPB(pbproxy);
        }
      });
}
项目:big-c    文件:TestQJMWithFaults.java   
@Override
protected QJournalProtocol createProxy() throws IOException {
  final QJournalProtocol realProxy = super.createProxy();
  QJournalProtocol mock = mockProxy(
      new WrapEveryCall<Object>(realProxy) {
        void beforeCall(InvocationOnMock invocation) throws Exception {
          rpcCount++;
          String callStr = "[" + addr + "] " + 
              invocation.getMethod().getName() + "(" +
              Joiner.on(", ").join(invocation.getArguments()) + ")";

          Callable<Void> inject = injections.get(rpcCount);
          if (inject != null) {
            LOG.info("Injecting code before IPC #" + rpcCount + ": " +
                callStr);
            inject.call();
          } else {
            LOG.info("IPC call #" + rpcCount + ": " + callStr);
          }
        }
      });
  return mock;
}
项目:hadoop-2.6.0-cdh5.4.3    文件:IPCLoggerChannel.java   
protected QJournalProtocol createProxy() throws IOException {
  final Configuration confCopy = new Configuration(conf);

  // Need to set NODELAY or else batches larger than MTU can trigger 
  // 40ms nagling delays.
  confCopy.setBoolean(
      CommonConfigurationKeysPublic.IPC_CLIENT_TCPNODELAY_KEY,
      true);

  RPC.setProtocolEngine(confCopy,
      QJournalProtocolPB.class, ProtobufRpcEngine.class);
  return SecurityUtil.doAsLoginUser(
      new PrivilegedExceptionAction<QJournalProtocol>() {
        @Override
        public QJournalProtocol run() throws IOException {
          RPC.setProtocolEngine(confCopy,
              QJournalProtocolPB.class, ProtobufRpcEngine.class);
          QJournalProtocolPB pbproxy = RPC.getProxy(
              QJournalProtocolPB.class,
              RPC.getProtocolVersion(QJournalProtocolPB.class),
              addr, confCopy);
          return new QJournalProtocolTranslatorPB(pbproxy);
        }
      });
}
项目:hadoop-2.6.0-cdh5.4.3    文件:TestQJMWithFaults.java   
@Override
protected QJournalProtocol createProxy() throws IOException {
  final QJournalProtocol realProxy = super.createProxy();
  QJournalProtocol mock = mockProxy(
      new WrapEveryCall<Object>(realProxy) {
        void beforeCall(InvocationOnMock invocation) throws Exception {
          rpcCount++;
          String callStr = "[" + addr + "] " + 
              invocation.getMethod().getName() + "(" +
              Joiner.on(", ").join(invocation.getArguments()) + ")";

          Callable<Void> inject = injections.get(rpcCount);
          if (inject != null) {
            LOG.info("Injecting code before IPC #" + rpcCount + ": " +
                callStr);
            inject.call();
          } else {
            LOG.info("IPC call #" + rpcCount + ": " + callStr);
          }
        }
      });
  return mock;
}
项目:hadoop-EAR    文件:TestQJMWithFaults.java   
@Override
protected QJournalProtocol createProxy() throws IOException {
  final QJournalProtocol realProxy = super.createProxy();
  QJournalProtocol mock = mockProxy(
      new WrapEveryCall<Object>(realProxy) {
        void beforeCall(InvocationOnMock invocation) throws Exception {
          rpcCount++;
          String callStr = "[" + addr + "] " + 
              invocation.getMethod().getName() + "(" +
              Joiner.on(", ").join(invocation.getArguments()) + ")";

          Callable<Void> inject = injections.get(rpcCount);
          if (inject != null) {
            LOG.info("Injecting code before IPC #" + rpcCount + ": " +
                callStr);
            inject.call();
          } else {
            LOG.info("IPC call #" + rpcCount + ": " + callStr);
          }
        }
      });
  return mock;
}
项目:hadoop-plus    文件:IPCLoggerChannel.java   
protected QJournalProtocol createProxy() throws IOException {
  final Configuration confCopy = new Configuration(conf);

  // Need to set NODELAY or else batches larger than MTU can trigger 
  // 40ms nagling delays.
  confCopy.setBoolean(
      CommonConfigurationKeysPublic.IPC_CLIENT_TCPNODELAY_KEY,
      true);

  RPC.setProtocolEngine(confCopy,
      QJournalProtocolPB.class, ProtobufRpcEngine.class);
  return SecurityUtil.doAsLoginUser(
      new PrivilegedExceptionAction<QJournalProtocol>() {
        @Override
        public QJournalProtocol run() throws IOException {
          RPC.setProtocolEngine(confCopy,
              QJournalProtocolPB.class, ProtobufRpcEngine.class);
          QJournalProtocolPB pbproxy = RPC.getProxy(
              QJournalProtocolPB.class,
              RPC.getProtocolVersion(QJournalProtocolPB.class),
              addr, confCopy);
          return new QJournalProtocolTranslatorPB(pbproxy);
        }
      });
}
项目:hadoop-plus    文件:TestQJMWithFaults.java   
@Override
protected QJournalProtocol createProxy() throws IOException {
  final QJournalProtocol realProxy = super.createProxy();
  QJournalProtocol mock = mockProxy(
      new WrapEveryCall<Object>(realProxy) {
        void beforeCall(InvocationOnMock invocation) throws Exception {
          rpcCount++;
          String callStr = "[" + addr + "] " + 
              invocation.getMethod().getName() + "(" +
              Joiner.on(", ").join(invocation.getArguments()) + ")";

          Callable<Void> inject = injections.get(rpcCount);
          if (inject != null) {
            LOG.info("Injecting code before IPC #" + rpcCount + ": " +
                callStr);
            inject.call();
          } else {
            LOG.info("IPC call #" + rpcCount + ": " + callStr);
          }
        }
      });
  return mock;
}
项目:FlexMap    文件:IPCLoggerChannel.java   
protected QJournalProtocol createProxy() throws IOException {
  final Configuration confCopy = new Configuration(conf);

  // Need to set NODELAY or else batches larger than MTU can trigger 
  // 40ms nagling delays.
  confCopy.setBoolean(
      CommonConfigurationKeysPublic.IPC_CLIENT_TCPNODELAY_KEY,
      true);

  RPC.setProtocolEngine(confCopy,
      QJournalProtocolPB.class, ProtobufRpcEngine.class);
  return SecurityUtil.doAsLoginUser(
      new PrivilegedExceptionAction<QJournalProtocol>() {
        @Override
        public QJournalProtocol run() throws IOException {
          RPC.setProtocolEngine(confCopy,
              QJournalProtocolPB.class, ProtobufRpcEngine.class);
          QJournalProtocolPB pbproxy = RPC.getProxy(
              QJournalProtocolPB.class,
              RPC.getProtocolVersion(QJournalProtocolPB.class),
              addr, confCopy);
          return new QJournalProtocolTranslatorPB(pbproxy);
        }
      });
}
项目:FlexMap    文件:TestQJMWithFaults.java   
@Override
protected QJournalProtocol createProxy() throws IOException {
  final QJournalProtocol realProxy = super.createProxy();
  QJournalProtocol mock = mockProxy(
      new WrapEveryCall<Object>(realProxy) {
        void beforeCall(InvocationOnMock invocation) throws Exception {
          rpcCount++;
          String callStr = "[" + addr + "] " + 
              invocation.getMethod().getName() + "(" +
              Joiner.on(", ").join(invocation.getArguments()) + ")";

          Callable<Void> inject = injections.get(rpcCount);
          if (inject != null) {
            LOG.info("Injecting code before IPC #" + rpcCount + ": " +
                callStr);
            inject.call();
          } else {
            LOG.info("IPC call #" + rpcCount + ": " + callStr);
          }
        }
      });
  return mock;
}
项目:hadoop-TCP    文件:IPCLoggerChannel.java   
protected QJournalProtocol createProxy() throws IOException {
  final Configuration confCopy = new Configuration(conf);

  // Need to set NODELAY or else batches larger than MTU can trigger 
  // 40ms nagling delays.
  confCopy.setBoolean(
      CommonConfigurationKeysPublic.IPC_CLIENT_TCPNODELAY_KEY,
      true);

  RPC.setProtocolEngine(confCopy,
      QJournalProtocolPB.class, ProtobufRpcEngine.class);
  return SecurityUtil.doAsLoginUser(
      new PrivilegedExceptionAction<QJournalProtocol>() {
        @Override
        public QJournalProtocol run() throws IOException {
          RPC.setProtocolEngine(confCopy,
              QJournalProtocolPB.class, ProtobufRpcEngine.class);
          QJournalProtocolPB pbproxy = RPC.getProxy(
              QJournalProtocolPB.class,
              RPC.getProtocolVersion(QJournalProtocolPB.class),
              addr, confCopy);
          return new QJournalProtocolTranslatorPB(pbproxy);
        }
      });
}
项目:hadoop-TCP    文件:TestQJMWithFaults.java   
@Override
protected QJournalProtocol createProxy() throws IOException {
  final QJournalProtocol realProxy = super.createProxy();
  QJournalProtocol mock = mockProxy(
      new WrapEveryCall<Object>(realProxy) {
        void beforeCall(InvocationOnMock invocation) throws Exception {
          rpcCount++;
          String callStr = "[" + addr + "] " + 
              invocation.getMethod().getName() + "(" +
              Joiner.on(", ").join(invocation.getArguments()) + ")";

          Callable<Void> inject = injections.get(rpcCount);
          if (inject != null) {
            LOG.info("Injecting code before IPC #" + rpcCount + ": " +
                callStr);
            inject.call();
          } else {
            LOG.info("IPC call #" + rpcCount + ": " + callStr);
          }
        }
      });
  return mock;
}
项目:hardfs    文件:IPCLoggerChannel.java   
protected QJournalProtocol createProxy() throws IOException {
  final Configuration confCopy = new Configuration(conf);

  // Need to set NODELAY or else batches larger than MTU can trigger 
  // 40ms nagling delays.
  confCopy.setBoolean(
      CommonConfigurationKeysPublic.IPC_CLIENT_TCPNODELAY_KEY,
      true);

  RPC.setProtocolEngine(confCopy,
      QJournalProtocolPB.class, ProtobufRpcEngine.class);
  return SecurityUtil.doAsLoginUser(
      new PrivilegedExceptionAction<QJournalProtocol>() {
        @Override
        public QJournalProtocol run() throws IOException {
          RPC.setProtocolEngine(confCopy,
              QJournalProtocolPB.class, ProtobufRpcEngine.class);
          QJournalProtocolPB pbproxy = RPC.getProxy(
              QJournalProtocolPB.class,
              RPC.getProtocolVersion(QJournalProtocolPB.class),
              addr, confCopy);
          return new QJournalProtocolTranslatorPB(pbproxy);
        }
      });
}
项目:hardfs    文件:TestQJMWithFaults.java   
@Override
protected QJournalProtocol createProxy() throws IOException {
  final QJournalProtocol realProxy = super.createProxy();
  QJournalProtocol mock = mockProxy(
      new WrapEveryCall<Object>(realProxy) {
        void beforeCall(InvocationOnMock invocation) throws Exception {
          rpcCount++;
          String callStr = "[" + addr + "] " + 
              invocation.getMethod().getName() + "(" +
              Joiner.on(", ").join(invocation.getArguments()) + ")";

          Callable<Void> inject = injections.get(rpcCount);
          if (inject != null) {
            LOG.info("Injecting code before IPC #" + rpcCount + ": " +
                callStr);
            inject.call();
          } else {
            LOG.info("IPC call #" + rpcCount + ": " + callStr);
          }
        }
      });
  return mock;
}
项目:hadoop-on-lustre2    文件:IPCLoggerChannel.java   
protected QJournalProtocol createProxy() throws IOException {
  final Configuration confCopy = new Configuration(conf);

  // Need to set NODELAY or else batches larger than MTU can trigger 
  // 40ms nagling delays.
  confCopy.setBoolean(
      CommonConfigurationKeysPublic.IPC_CLIENT_TCPNODELAY_KEY,
      true);

  RPC.setProtocolEngine(confCopy,
      QJournalProtocolPB.class, ProtobufRpcEngine.class);
  return SecurityUtil.doAsLoginUser(
      new PrivilegedExceptionAction<QJournalProtocol>() {
        @Override
        public QJournalProtocol run() throws IOException {
          RPC.setProtocolEngine(confCopy,
              QJournalProtocolPB.class, ProtobufRpcEngine.class);
          QJournalProtocolPB pbproxy = RPC.getProxy(
              QJournalProtocolPB.class,
              RPC.getProtocolVersion(QJournalProtocolPB.class),
              addr, confCopy);
          return new QJournalProtocolTranslatorPB(pbproxy);
        }
      });
}
项目:hadoop-on-lustre2    文件:TestQJMWithFaults.java   
@Override
protected QJournalProtocol createProxy() throws IOException {
  final QJournalProtocol realProxy = super.createProxy();
  QJournalProtocol mock = mockProxy(
      new WrapEveryCall<Object>(realProxy) {
        void beforeCall(InvocationOnMock invocation) throws Exception {
          rpcCount++;
          String callStr = "[" + addr + "] " + 
              invocation.getMethod().getName() + "(" +
              Joiner.on(", ").join(invocation.getArguments()) + ")";

          Callable<Void> inject = injections.get(rpcCount);
          if (inject != null) {
            LOG.info("Injecting code before IPC #" + rpcCount + ": " +
                callStr);
            inject.call();
          } else {
            LOG.info("IPC call #" + rpcCount + ": " + callStr);
          }
        }
      });
  return mock;
}
项目:hadoop    文件:TestIPCLoggerChannel.java   
@Before
public void setupMock() {
  conf.setInt(DFSConfigKeys.DFS_QJOURNAL_QUEUE_SIZE_LIMIT_KEY,
      LIMIT_QUEUE_SIZE_MB);

  // Channel to the mock object instead of a real IPC proxy.
  ch = new IPCLoggerChannel(conf, FAKE_NSINFO, JID, FAKE_ADDR) {
    @Override
    protected QJournalProtocol getProxy() throws IOException {
      return mockProxy;
    }
  };

  ch.setEpoch(1);
}
项目:hadoop    文件:TestQJMWithFaults.java   
private static QJournalProtocol mockProxy(WrapEveryCall<Object> wrapper)
    throws IOException {
  QJournalProtocol mock = Mockito.mock(QJournalProtocol.class,
      Mockito.withSettings()
        .defaultAnswer(wrapper)
        .extraInterfaces(Closeable.class));
  return mock;
}
项目:aliyun-oss-hadoop-fs    文件:TestIPCLoggerChannel.java   
@Before
public void setupMock() {
  conf.setInt(DFSConfigKeys.DFS_QJOURNAL_QUEUE_SIZE_LIMIT_KEY,
      LIMIT_QUEUE_SIZE_MB);

  // Channel to the mock object instead of a real IPC proxy.
  ch = new IPCLoggerChannel(conf, FAKE_NSINFO, JID, FAKE_ADDR) {
    @Override
    protected QJournalProtocol getProxy() throws IOException {
      return mockProxy;
    }
  };

  ch.setEpoch(1);
}
项目:aliyun-oss-hadoop-fs    文件:TestQJMWithFaults.java   
private static QJournalProtocol mockProxy(WrapEveryCall<Object> wrapper)
    throws IOException {
  QJournalProtocol mock = Mockito.mock(QJournalProtocol.class,
      Mockito.withSettings()
        .defaultAnswer(wrapper)
        .extraInterfaces(Closeable.class));
  return mock;
}
项目:big-c    文件:TestIPCLoggerChannel.java   
@Before
public void setupMock() {
  conf.setInt(DFSConfigKeys.DFS_QJOURNAL_QUEUE_SIZE_LIMIT_KEY,
      LIMIT_QUEUE_SIZE_MB);

  // Channel to the mock object instead of a real IPC proxy.
  ch = new IPCLoggerChannel(conf, FAKE_NSINFO, JID, FAKE_ADDR) {
    @Override
    protected QJournalProtocol getProxy() throws IOException {
      return mockProxy;
    }
  };

  ch.setEpoch(1);
}
项目:big-c    文件:TestQJMWithFaults.java   
private static QJournalProtocol mockProxy(WrapEveryCall<Object> wrapper)
    throws IOException {
  QJournalProtocol mock = Mockito.mock(QJournalProtocol.class,
      Mockito.withSettings()
        .defaultAnswer(wrapper)
        .extraInterfaces(Closeable.class));
  return mock;
}
项目:hadoop-2.6.0-cdh5.4.3    文件:TestIPCLoggerChannel.java   
@Before
public void setupMock() {
  conf.setInt(DFSConfigKeys.DFS_QJOURNAL_QUEUE_SIZE_LIMIT_KEY,
      LIMIT_QUEUE_SIZE_MB);

  // Channel to the mock object instead of a real IPC proxy.
  ch = new IPCLoggerChannel(conf, FAKE_NSINFO, JID, FAKE_ADDR) {
    @Override
    protected QJournalProtocol getProxy() throws IOException {
      return mockProxy;
    }
  };

  ch.setEpoch(1);
}
项目:hadoop-2.6.0-cdh5.4.3    文件:TestQJMWithFaults.java   
private static QJournalProtocol mockProxy(WrapEveryCall<Object> wrapper)
    throws IOException {
  QJournalProtocol mock = Mockito.mock(QJournalProtocol.class,
      Mockito.withSettings()
        .defaultAnswer(wrapper)
        .extraInterfaces(Closeable.class));
  return mock;
}
项目:hadoop-EAR    文件:TestIPCLoggerChannel.java   
@Before
public void setupMock() {
  conf.setInt(JournalConfigKeys.DFS_QJOURNAL_QUEUE_SIZE_LIMIT_KEY,
      LIMIT_QUEUE_SIZE_MB);

  // Channel to the mock object instead of a real IPC proxy.
  ch = new IPCLoggerChannel(conf, FAKE_NSINFO, JID, FAKE_ADDR) {
    @Override
    protected QJournalProtocol getProxy() throws IOException {
      return mockProxy;
    }
  };

  ch.setEpoch(1);
}
项目:hadoop-EAR    文件:TestQJMWithFaults.java   
private static QJournalProtocol mockProxy(WrapEveryCall<Object> wrapper)
    throws IOException {
  QJournalProtocol mock = Mockito.mock(QJournalProtocol.class,
      Mockito.withSettings()
        .defaultAnswer(wrapper)
        .extraInterfaces(Closeable.class));
  return mock;
}
项目:hadoop-EAR    文件:IPCLoggerChannel.java   
protected QJournalProtocol createProxy() throws IOException {
  final Configuration confCopy = new Configuration(conf);
  // Need to set NODELAY or else batches larger than MTU can trigger
  // 40ms nagling delays.
  confCopy.setBoolean("ipc.client.tcpnodelay", true);
  long connectionTimeout = conf.getLong(
      JournalConfigKeys.DFS_QJOURNAL_CONNECT_TIMEOUT_KEY, Long.MAX_VALUE);
  return (QJournalProtocol) RPC.waitForProxy(QJournalProtocol.class,
      QJournalProtocol.versionID, addr, confCopy, connectionTimeout, 0);
}
项目:hadoop-EAR    文件:JournalNodeRpcServer.java   
@Override
public long getProtocolVersion(String protocol, long clientVersion)
    throws VersionIncompatible, IOException {
  if (protocol.equals(QJournalProtocol.class.getName())){
    return QJournalProtocol.versionID;
  } else {
    throw new IOException("Unknown protocol: " + protocol);
  }
}
项目:hadoop-EAR    文件:JournalNodeRpcServer.java   
public static void init() {
  try {
    FastProtocolRegister.register(FastProtocolId.SERIAL_VERSION_ID_1,
        QJournalProtocol.class.getMethod("journal",
            JournalRequestInfo.class));
  } catch (Exception e) {
    throw new RuntimeException(e);
  }
}
项目:hadoop-plus    文件:TestIPCLoggerChannel.java   
@Before
public void setupMock() {
  conf.setInt(DFSConfigKeys.DFS_QJOURNAL_QUEUE_SIZE_LIMIT_KEY,
      LIMIT_QUEUE_SIZE_MB);

  // Channel to the mock object instead of a real IPC proxy.
  ch = new IPCLoggerChannel(conf, FAKE_NSINFO, JID, FAKE_ADDR) {
    @Override
    protected QJournalProtocol getProxy() throws IOException {
      return mockProxy;
    }
  };

  ch.setEpoch(1);
}
项目:hadoop-plus    文件:TestQJMWithFaults.java   
private static QJournalProtocol mockProxy(WrapEveryCall<Object> wrapper)
    throws IOException {
  QJournalProtocol mock = Mockito.mock(QJournalProtocol.class,
      Mockito.withSettings()
        .defaultAnswer(wrapper)
        .extraInterfaces(Closeable.class));
  return mock;
}
项目:FlexMap    文件:TestIPCLoggerChannel.java   
@Before
public void setupMock() {
  conf.setInt(DFSConfigKeys.DFS_QJOURNAL_QUEUE_SIZE_LIMIT_KEY,
      LIMIT_QUEUE_SIZE_MB);

  // Channel to the mock object instead of a real IPC proxy.
  ch = new IPCLoggerChannel(conf, FAKE_NSINFO, JID, FAKE_ADDR) {
    @Override
    protected QJournalProtocol getProxy() throws IOException {
      return mockProxy;
    }
  };

  ch.setEpoch(1);
}
项目:FlexMap    文件:TestQJMWithFaults.java   
private static QJournalProtocol mockProxy(WrapEveryCall<Object> wrapper)
    throws IOException {
  QJournalProtocol mock = Mockito.mock(QJournalProtocol.class,
      Mockito.withSettings()
        .defaultAnswer(wrapper)
        .extraInterfaces(Closeable.class));
  return mock;
}
项目:hadoop-TCP    文件:TestIPCLoggerChannel.java   
@Before
public void setupMock() {
  conf.setInt(DFSConfigKeys.DFS_QJOURNAL_QUEUE_SIZE_LIMIT_KEY,
      LIMIT_QUEUE_SIZE_MB);

  // Channel to the mock object instead of a real IPC proxy.
  ch = new IPCLoggerChannel(conf, FAKE_NSINFO, JID, FAKE_ADDR) {
    @Override
    protected QJournalProtocol getProxy() throws IOException {
      return mockProxy;
    }
  };

  ch.setEpoch(1);
}
项目:hadoop-TCP    文件:TestQJMWithFaults.java   
private static QJournalProtocol mockProxy(WrapEveryCall<Object> wrapper)
    throws IOException {
  QJournalProtocol mock = Mockito.mock(QJournalProtocol.class,
      Mockito.withSettings()
        .defaultAnswer(wrapper)
        .extraInterfaces(Closeable.class));
  return mock;
}
项目:hardfs    文件:TestIPCLoggerChannel.java   
@Before
public void setupMock() {
  conf.setInt(DFSConfigKeys.DFS_QJOURNAL_QUEUE_SIZE_LIMIT_KEY,
      LIMIT_QUEUE_SIZE_MB);

  // Channel to the mock object instead of a real IPC proxy.
  ch = new IPCLoggerChannel(conf, FAKE_NSINFO, JID, FAKE_ADDR) {
    @Override
    protected QJournalProtocol getProxy() throws IOException {
      return mockProxy;
    }
  };

  ch.setEpoch(1);
}
项目:hardfs    文件:TestQJMWithFaults.java   
private static QJournalProtocol mockProxy(WrapEveryCall<Object> wrapper)
    throws IOException {
  QJournalProtocol mock = Mockito.mock(QJournalProtocol.class,
      Mockito.withSettings()
        .defaultAnswer(wrapper)
        .extraInterfaces(Closeable.class));
  return mock;
}