Example #1
0
 public void SetUp()
 {
     this.hostname       = "TESTSERVER";
     this.portNumber     = 14000;
     this.authentication = new HadoopUsernameAuthentication("hduser");
     this.directoryPath  = "/UnitTest" + DateTime.Now.ToString("yyyyMMddHHmmss");
 }
Example #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="HadoopFileSystemOperation" /> class.
 /// </summary>
 /// <param name="path">The path of the operation.</param>
 /// <param name="authentication">The authentication.</param>
 /// <exception cref="System.ArgumentNullException">
 /// The path is null.
 /// or
 /// The authentication is null.
 /// </exception>
 /// <exception cref="System.ArgumentException">The path is empty.</exception>
 protected HadoopFileSystemOperation(String path, IHadoopAuthentication authentication)
     : this()
 {
     if (path == null)
     {
         throw new ArgumentNullException(nameof(path));
     }
     if (String.IsNullOrEmpty(path))
     {
         throw new ArgumentException(StorageMessages.PathIsEmpty, nameof(path));
     }
     this.Path           = path;
     this.Authentication = authentication ?? throw new ArgumentNullException(nameof(authentication));
 }
Example #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="HadoopRenameOperation" /> class.
        /// </summary>
        /// <param name="client">The HTTP client.</param>
        /// <param name="path">The path.</param>
        /// <param name="authentication">The authentication.</param>
        /// <param name="destination">The destination path.</param>
        /// <exception cref="System.ArgumentNullException">
        /// The client is null.
        /// or
        /// The path is null.
        /// or
        /// The authentication is null.
        /// or
        /// The destination path is null.
        /// </exception>
        /// <exception cref="System.ArgumentException">
        /// The path is empty.
        /// or
        /// The destination path is empty.
        /// </exception>
        public HadoopRenameOperation(HttpClient client, String path, IHadoopAuthentication authentication, String destination)
            : base(client, null, path, authentication)
        {
            if (destination == null)
            {
                throw new ArgumentNullException(nameof(destination));
            }
            if (String.IsNullOrEmpty(destination))
            {
                throw new ArgumentException(StorageMessages.DestinationPathIsEmpty, nameof(destination));
            }

            this.Destination = destination;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="HadoopReadFileOperation" /> class.
        /// </summary>
        /// <param name="path">The path.</param>
        /// <param name="authentication">The authentication.</param>
        /// <param name="offset">The zero based byte offset in the file.</param>
        /// <param name="length">The number of bytes to be read.</param>
        /// <exception cref="System.ArgumentOutOfRangeException">
        /// The offset is less than 0.
        /// or
        /// The length is less than 0.
        /// </exception>
        /// <exception cref="System.ArgumentNullException">
        /// The path is null.
        /// or
        /// The authentication is null.
        /// </exception>
        /// <exception cref="System.ArgumentException">The path is empty.</exception>
        public HadoopReadFileOperation(String path, IHadoopAuthentication authentication, Int64 offset, Int64 length)
            : base(path, authentication)
        {
            if (offset < 0)
            {
                throw new ArgumentOutOfRangeException(nameof(offset), StorageMessages.OffsetIsLessThan0);
            }
            if (length < 0)
            {
                throw new ArgumentOutOfRangeException(nameof(length), StorageMessages.LengthIsLessThan0);
            }

            this.Offset = offset;
            this.Length = length;
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="HadoopCreateDirectoryOperation" /> class.
 /// </summary>
 /// <param name="client">The HTTP client.</param>
 /// <param name="path">The path.</param>
 /// <param name="authentication">The authentication.</param>
 /// <exception cref="System.ArgumentNullException">
 /// The client is null.
 /// or
 /// The path is null.
 /// or
 /// The authentication is null.
 /// </exception>
 /// <exception cref="System.ArgumentException">The path is empty.</exception>
 public HadoopCreateDirectoryOperation(HttpClient client, String path, IHadoopAuthentication authentication)
     : base(client, null, path, authentication)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="HadoopCreateDirectoryOperation" /> class.
 /// </summary>
 /// <param name="path">The path.</param>
 /// <param name="authentication">The authentication.</param>
 /// <exception cref="System.ArgumentNullException">
 /// The path is null.
 /// or
 /// The authentication is null.
 /// </exception>
 /// <exception cref="System.ArgumentException">The path is empty.</exception>
 public HadoopCreateDirectoryOperation(String path, IHadoopAuthentication authentication)
     : base(path, authentication)
 {
 }
Example #7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="HadoopFileListingOperation" /> class.
 /// </summary>
 /// <param name="client">The HTTP client.</param>
 /// <param name="path">The path.</param>
 /// <param name="authentication">The authentication.</param>
 /// <exception cref="System.ArgumentNullException">
 /// The client is null.
 /// or
 /// The path is null.
 /// or
 /// The authentication is null.
 /// </exception>
 /// <exception cref="System.ArgumentException">The path is empty.</exception>
 public HadoopFileListingOperation(HttpClient client, String path, IHadoopAuthentication authentication)
     : base(client, null, path, authentication)
 {
 }
Example #8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="HadoopFileListingOperation" /> class.
 /// </summary>
 /// <param name="path">The path.</param>
 /// <param name="authentication">The authentication.</param>
 /// <exception cref="System.ArgumentNullException">
 /// The path is null.
 /// or
 /// The authentication is null.
 /// </exception>
 /// <exception cref="System.ArgumentException">The path is empty.</exception>
 public HadoopFileListingOperation(String path, IHadoopAuthentication authentication)
     : base(path, authentication)
 {
 }
Example #9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="HadoopDeleteOperation" /> class.
 /// </summary>
 /// <param name="client">The HTTP client.</param>
 /// <param name="path">The path.</param>
 /// <param name="authentication">The authentication.</param>
 /// <param name="recursive">A value indicating whether the deletion is recursive.</param>
 /// <exception cref="System.ArgumentNullException">
 /// The client is null.
 /// or
 /// The path is null.
 /// or
 /// The authentication is null.
 /// </exception>
 /// <exception cref="System.ArgumentException">The path is empty.</exception>
 public HadoopDeleteOperation(HttpClient client, String path, IHadoopAuthentication authentication, Boolean recursive)
     : base(client, null, path, authentication)
 {
     this.Recursive = recursive;
 }
Example #10
0
 /// <summary>
 /// Initializes a new instance of the <see cref="HadoopDeleteOperation" /> class.
 /// </summary>
 /// <param name="path">The path.</param>
 /// <param name="authentication">The authentication.</param>
 /// <param name="recursive">A value indicating whether the deletion is recursive.</param>
 /// <exception cref="System.ArgumentNullException">
 /// The path is null.
 /// or
 /// The authentication is null.
 /// </exception>
 /// <exception cref="System.ArgumentException">The path is empty.</exception>
 public HadoopDeleteOperation(String path, IHadoopAuthentication authentication, Boolean recursive)
     : base(path, authentication)
 {
     this.Recursive = recursive;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="HadoopReadFileOperation" /> class.
 /// </summary>
 /// <param name="path">The path.</param>
 /// <param name="authentication">The authentication.</param>
 /// <exception cref="System.ArgumentNullException">
 /// The path is null.
 /// or
 /// The authentication is null.
 /// </exception>
 /// <exception cref="System.ArgumentException">The path is empty.</exception>
 public HadoopReadFileOperation(String path, IHadoopAuthentication authentication)
     : base(path, authentication)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="HadoopWriteFileOperation" /> class.
 /// </summary>
 /// <param name="client">The HTTP client.</param>
 /// <param name="content">The HTTP content.</param>
 /// <param name="path">The path.</param>
 /// <param name="authentication">The authentication.</param>
 /// <exception cref="System.ArgumentNullException">
 /// The client is null.
 /// or
 /// The path is null.
 /// or
 /// The authentication is null.
 /// </exception>
 /// <exception cref="System.ArgumentException">The path is empty.</exception>
 public HadoopWriteFileOperation(HttpClient client, HttpContent content, String path, IHadoopAuthentication authentication)
     : base(client, content, path, authentication)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="HadoopFileStatusOperation" /> class.
 /// </summary>
 /// <param name="path">The path.</param>
 /// <param name="authentication">The authentication.</param>
 /// <exception cref="System.ArgumentNullException">
 /// The path is null.
 /// or
 /// The authentication is null.
 /// </exception>
 /// <exception cref="System.ArgumentException">The path is empty.</exception>
 public HadoopFileStatusOperation(String path, IHadoopAuthentication authentication)
     : base(path, authentication)
 {
 }