MCPcopy Create free account
hub / github.com/apache/arrow / TEST

Function TEST

cpp/src/arrow/filesystem/hdfs_test.cc:46–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44namespace fs {
45
46TEST(TestHdfsOptions, FromUri) {
47 HdfsOptions options;
48 Uri uri;
49
50 ASSERT_OK(uri.Parse("hdfs://localhost"));
51 ASSERT_OK_AND_ASSIGN(options, HdfsOptions::FromUri(uri));
52 ASSERT_EQ(options.replication, 3);
53 ASSERT_EQ(options.host(), "hdfs://localhost");
54 ASSERT_EQ(options.port(), 0);
55 ASSERT_EQ(options.user(), "");
56
57 ASSERT_OK(uri.Parse("hdfs://otherhost:9999/?replication=2&kerb_ticket=kerb.ticket"));
58 ASSERT_OK_AND_ASSIGN(options, HdfsOptions::FromUri(uri));
59 ASSERT_EQ(options.replication, 2);
60 ASSERT_EQ(options.kerb_ticket(), "kerb.ticket");
61 ASSERT_EQ(options.host(), "hdfs://otherhost");
62 ASSERT_EQ(options.port(), 9999);
63 ASSERT_EQ(options.user(), "");
64
65 ASSERT_OK(uri.Parse("hdfs://otherhost:9999/?hdfs_token=hdfs_token_ticket"));
66 ASSERT_OK_AND_ASSIGN(options, HdfsOptions::FromUri(uri));
67 ASSERT_EQ(options.host(), "hdfs://otherhost");
68 ASSERT_EQ(options.port(), 9999);
69 ASSERT_EQ(options.extra_conf().at("hdfs_token"), "hdfs_token_ticket");
70
71 ASSERT_OK(uri.Parse("viewfs://other-nn/mypath/myfile"));
72 ASSERT_OK_AND_ASSIGN(options, HdfsOptions::FromUri(uri));
73 ASSERT_EQ(options.host(), "viewfs://other-nn");
74 ASSERT_EQ(options.port(), 0);
75 ASSERT_EQ(options.user(), "");
76}
77
78class HadoopFileSystemTestMixin {
79 public:

Callers

nothing calls this directly

Calls 4

hostMethod · 0.80
ASSERT_OK_AND_ASSIGNFunction · 0.70
ParseMethod · 0.45
portMethod · 0.45

Tested by

no test coverage detected