public _PrivilegedExceptionAction_246(HftpFileSystem _enclosing, string renewer, string proxyUser) { this._enclosing = _enclosing; this.renewer = renewer; this.proxyUser = proxyUser; }
public virtual void InitFileSystems() { hdfs = cluster.GetFileSystem(); hftpFs = (HftpFileSystem) new Path(hftpUri).GetFileSystem(config); // clear out the namespace foreach (FileStatus stat in hdfs.ListStatus(new Path("/"))) { hdfs.Delete(stat.GetPath(), true); } }
public virtual void TestHftpCustomUriPortWithDefaultPorts() { Configuration conf = new Configuration(); URI uri = URI.Create("hftp://localhost:123"); HftpFileSystem fs = (HftpFileSystem)FileSystem.Get(uri, conf); NUnit.Framework.Assert.AreEqual(DFSConfigKeys.DfsNamenodeHttpPortDefault, fs.GetDefaultPort ()); NUnit.Framework.Assert.AreEqual(uri, fs.GetUri()); NUnit.Framework.Assert.AreEqual("127.0.0.1:123", fs.GetCanonicalServiceName()); }
public virtual void TestTimeout() { Configuration conf = new Configuration(); URI uri = URI.Create("hftp://localhost"); HftpFileSystem fs = (HftpFileSystem)FileSystem.Get(uri, conf); URLConnection conn = fs.connectionFactory.OpenConnection(new Uri("http://localhost" )); NUnit.Framework.Assert.AreEqual(URLConnectionFactory.DefaultSocketTimeout, conn.GetConnectTimeout ()); NUnit.Framework.Assert.AreEqual(URLConnectionFactory.DefaultSocketTimeout, conn.GetReadTimeout ()); }
/// <exception cref="Org.Xml.Sax.SAXException"/> public override void StartElement(string ns, string localname, string qname, Attributes attrs) { if (!typeof(ContentSummary).FullName.Equals(qname)) { if (typeof(RemoteException).Name.Equals(qname)) { throw new SAXException(RemoteException.ValueOf(attrs)); } throw new SAXException("Unrecognized entry: " + qname); } this.contentsummary = HftpFileSystem.ToContentSummary(attrs); }
public virtual void TestHftpCustomDefaultPorts() { Configuration conf = new Configuration(); conf.SetInt(DFSConfigKeys.DfsNamenodeHttpPortKey, 123); URI uri = URI.Create("hftp://localhost"); HftpFileSystem fs = (HftpFileSystem)FileSystem.Get(uri, conf); NUnit.Framework.Assert.AreEqual(123, fs.GetDefaultPort()); NUnit.Framework.Assert.AreEqual(uri, fs.GetUri()); // HFTP uses http to get the token so canonical service name should // return the http port. NUnit.Framework.Assert.AreEqual("127.0.0.1:123", fs.GetCanonicalServiceName()); }
public virtual void TestTokenCompatibilityFor203() { Configuration conf = new Configuration(); HftpFileSystem fs = new HftpFileSystem(); Org.Apache.Hadoop.Security.Token.Token <object> token = new Org.Apache.Hadoop.Security.Token.Token <TokenIdentifier>(new byte[0], new byte[0], DelegationTokenIdentifier.HdfsDelegationKind , new Text("127.0.0.1:8020")); Credentials cred = new Credentials(); cred.AddToken(HftpFileSystem.TokenKind, token); ByteArrayOutputStream os = new ByteArrayOutputStream(); cred.Write(new DataOutputStream(os)); HttpURLConnection conn = Org.Mockito.Mockito.Mock <HttpURLConnection>(); Org.Mockito.Mockito.DoReturn(new ByteArrayInputStream(os.ToByteArray())).When(conn ).GetInputStream(); Org.Mockito.Mockito.DoReturn(HttpURLConnection.HttpOk).When(conn).GetResponseCode (); URLConnectionFactory factory = Org.Mockito.Mockito.Mock <URLConnectionFactory>(); Org.Mockito.Mockito.DoReturn(conn).When(factory).OpenConnection(Org.Mockito.Mockito .Any <Uri>(), Matchers.AnyBoolean()); URI uri = new URI("hftp://127.0.0.1:8020"); fs.Initialize(uri, conf); fs.connectionFactory = factory; UserGroupInformation ugi = UserGroupInformation.CreateUserForTesting("foo", new string [] { "bar" }); TokenAspect <HftpFileSystem> tokenAspect = new TokenAspect <HftpFileSystem>(fs, SecurityUtil .BuildTokenService(uri), HftpFileSystem.TokenKind); tokenAspect.InitDelegationToken(ugi); tokenAspect.EnsureTokenInitialized(); NUnit.Framework.Assert.AreSame(HftpFileSystem.TokenKind, fs.GetRenewToken().GetKind ()); Org.Apache.Hadoop.Security.Token.Token <object> tok = (Org.Apache.Hadoop.Security.Token.Token <object>)Whitebox.GetInternalState(fs, "delegationToken"); NUnit.Framework.Assert.AreNotSame("Not making a copy of the remote token", token, tok); NUnit.Framework.Assert.AreEqual(token.GetKind(), tok.GetKind()); }
public _PrivilegedExceptionAction_717(HftpFileSystem _enclosing, Org.Apache.Hadoop.Security.Token.Token <object> token) { this._enclosing = _enclosing; this.token = token; }
protected override SimpleDateFormat InitialValue() { return(HftpFileSystem.GetDateFormat()); }
internal ContentSummaryParser(HftpFileSystem _enclosing) { this._enclosing = _enclosing; }
internal ChecksumParser(HftpFileSystem _enclosing) { this._enclosing = _enclosing; }
internal LsParser(HftpFileSystem _enclosing) { this._enclosing = _enclosing; }