Projects >> seqware >>989f7b20ffb41bc4e5dcfabc312fd68d8f4eb729

Chunk
Conflicting content
    return (false);
  }
  
<<<<<<< HEAD
  public boolean putToS3(BufferedInputStream reader, String output){
      return (putToS3(reader, output, false, ClientConfiguration.DEFAULT_SOCKET_TIMEOUT, ClientConfiguration.DEFAULT_MAX_CONNECTIONS, ClientConfiguration.DEFAULT_MAX_RETRIES, ClientConfiguration.DEFAULT_SOCKET_TIMEOUT));
=======
  public boolean putToHDFS(BufferedInputStream reader, String output){
    return(putToHDFS(reader, output, null, null));
  }
  
  /**
   * The output path is an HDFS URL that look like
   * hdfs:////
   * 
   * TODO:
   * 
   * 1) encryption/decryption
   * 2) support for dir or file writes
   * 
   * @param reader
   * @param output
   * @param decryptCipher
   * @param encryptCipher
   * @return 
   */
  public boolean putToHDFS(InputStream reader, String output, Cipher decryptCipher, Cipher encryptCipher) {
    try {      
      
      // Hadoop stuff
      Configuration conf = new Configuration();
      FileSystem fs = FileSystem.get(URI.create(output), conf);
      
      // delete if it already exists
      if (fs.exists(new Path(output))) {
        Log.stdout(" PATH EXISTS ");
        // delete it
      }
      
      OutputStream out = fs.create(new Path(output + "/foo.txt" ));
      IOUtils.copyBytes(reader, out, 4096, true);
     
      // Close all the file descripters
      reader.close();
      out.close();
      fs.close();
      return(true);
      
    } catch (IOException ex) {
      Logger.getLogger(ProvisionFilesUtil.class.getName()).log(Level.SEVERE, null, ex);
      return(false);
    }
>>>>>>> 8318abce8755f6bdd110e3cfeb842f363917318f
  }

  /**
Solution content
    return (false);
  }
  
  public boolean putToHDFS(BufferedInputStream reader, String output){
    return(putToHDFS(reader, output, null, null));
  }
  
  /**
   * The output path is an HDFS URL that look like
   * hdfs:////
   * 
   * TODO:
   * 
   * 1) encryption/decryption
   * 2) support for dir or file writes
   * 
   * @param reader
   * @param output
   * @param decryptCipher
   * @param encryptCipher
   * @return 
   */
  public boolean putToHDFS(InputStream reader, String output, Cipher decryptCipher, Cipher encryptCipher) {
    try {      
      
      // Hadoop stuff
      Configuration conf = new Configuration();
      FileSystem fs = FileSystem.get(URI.create(output), conf);
      
      // delete if it already exists
      if (fs.exists(new Path(output))) {
        Log.stdout(" PATH EXISTS ");
        // delete it
      }
      
      OutputStream out = fs.create(new Path(output + "/foo.txt" ));
      IOUtils.copyBytes(reader, out, 4096, true);
     
      // Close all the file descripters
      reader.close();
      out.close();
      fs.close();
      return(true);
      
    } catch (IOException ex) {
      Logger.getLogger(ProvisionFilesUtil.class.getName()).log(Level.SEVERE, null, ex);
      return(false);
    }
  }

  /**
File
ProvisionFilesUtil.java
Developer's decision
Version 2
Kind of conflict
Comment
Method declaration
Method invocation
Method signature
Return statement
Try statement
Chunk
Conflicting content
    if (output.startsWith("s3://")) {

      // put to S3
<<<<<<< HEAD
      result = filesUtil.putToS3(reader, output, fullOutputPath, decryptCipher, encryptCipher);
=======
      result = filesUtil.putToS3(reader, output, decryptCipher, encryptCipher);
>>>>>>> 8318abce8755f6bdd110e3cfeb842f363917318f

    } else if (output.startsWith("http://") || output.startsWith("https://")) {
Solution content
    if (output.startsWith("s3://")) {

      // put to S3
      result = filesUtil.putToS3(reader, output, fullOutputPath, decryptCipher, encryptCipher);

    } else if (output.startsWith("http://") || output.startsWith("https://")) {
File
ProvisionFiles.java
Developer's decision
Version 1
Kind of conflict
Method invocation
Variable