Esempio n. 1
0
  /** Parse a finished write operation by a datanode */
  public void parseFinishedDatanodeWriteOperation(
      String filePath, String fileName, String datanodeId, String errorMessage) throws Exception {

    // change the fileStructure according to the response
    FileStructureOperation fileStructureOp = new FileStructureOperationImpl();
    fileStructureOp.parseWriteOperationResponse(filePath, fileName, datanodeId, errorMessage);
  }
Esempio n. 2
0
  /** *********** OLD STUFF ********** */
  @Deprecated
  private void ls(Operation operation) throws Exception {
    // on an ls request, the parameter is a FilePathProto
    FilePathProto path = (FilePathProto) operation.getParamProto();

    // get the possible datanodes ids we can ls from
    FileStructureOperation fileStructureOperation = new FileStructureOperationImpl();
    List<String> validDatanodesIds = fileStructureOperation.ls(path.getPath());

    // figure the preferred datanode
    // DatanodeInfo datanode = Datanodes.findPreferredDatanode(validDatanodesIds);
    // DatanodeInfo datanode = Datanodes.findPreferredDatanode(null);
    DatanodeInfo datanode = new DatanodeInfo("datanode1", "127.0.0.1", 30000);

    // send the request to the datanode
    FileOperationReqProtocol fileOperationRequest =
        new FileOperationReqProtocolImpl(datanode, operation);
    fileOperationRequest.requestFileOperation();
  }