Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
141 commits
Select commit Hold shift + click to select a range
f00c0df
Create a branch for HDFS-6584: Support archival storage.
szetszwo Jul 11, 2014
6f41baa
HDFS-6677. Change INodeFile and FSImage to support storage policy ID.
szetszwo Jul 14, 2014
4f1fae8
HDFS-6670. Add block storage policy support with default HOT, WARM an…
szetszwo Jul 14, 2014
395c763
Merge r1609845 through r1610532 from trunk.
szetszwo Jul 14, 2014
38af610
HDFS-6671. Change BlockPlacementPolicy to consider block storage poli…
szetszwo Jul 17, 2014
04fd201
Merge r1609845 through r1611528 from trunk.
szetszwo Jul 18, 2014
2b07af0
Merge r1609845 through r1611734 from tunk.
szetszwo Jul 18, 2014
014be25
HDFS-6710. Change BlockPlacementPolicy to consider block storage poli…
szetszwo Jul 21, 2014
0a736fb
HDFS-6679. Bump NameNodeLayoutVersion and update editsStored test fil…
szetszwo Jul 21, 2014
ee3a327
Merge r1609845 through r1612268 from trunk.
szetszwo Jul 21, 2014
3de6c61
Merge r1609845 through r1612431 from trunk.
szetszwo Jul 21, 2014
ee13f8b
Merge r1609845 through r1612502 from trunk.
szetszwo Jul 22, 2014
ac5e8ae
HDFS-6686. Change BlockPlacementPolicy to use fallback when some stor…
szetszwo Jul 23, 2014
48dc486
Merge r1609845 through r1612880 from trunk.
szetszwo Jul 23, 2014
10d6210
Merge r1609845 through r1614231 from trunk.
szetszwo Jul 29, 2014
dc7744d
Merge r1609845 through r1615019 from trunk.
szetszwo Aug 1, 2014
b50cb5e
Merge r1609845 through r1616427 from trunk.
szetszwo Aug 7, 2014
9d5f8fa
Merging r1616428 through r1616893 from trunk.
Jing9 Aug 8, 2014
04884cd
Merging r1616894 through r1617376 from trunk.
Jing9 Aug 11, 2014
de3804f
Merging r1617377 through r1617565 from trunk.
Jing9 Aug 12, 2014
37207b7
HDFS-6835. Archival Storage: Add a new API to set storage policy. Con…
Jing9 Aug 12, 2014
9b250d7
HDFS-6847. Support storage policy on directories and include storage …
szetszwo Aug 16, 2014
cb75b6b
Merge r1609845 through r1618416 from trunk.
szetszwo Aug 16, 2014
5d5aae0
HDFS-6801. Archival Storage: Add a new data migration tool. Contribut…
Jing9 Aug 18, 2014
4e324bc
Merge r1609845 through r1618763 from trunk.
szetszwo Aug 18, 2014
c92d869
Merge r1609845 through r1619277 from trunk.
szetszwo Aug 21, 2014
603cbe5
HDFS-6863. Archival Storage: Support migration for snapshot paths. Co…
Jing9 Aug 21, 2014
e69954d
HDFS-6906. Archival Storage: Add more tests for BlockStoragePolicy. C…
Jing9 Aug 21, 2014
555900a
Merge branch 'trunk' into HDFS-6584
Jing9 Aug 27, 2014
8ea20b5
HDFS-6911. Archival Storage: check if a block is already scheduled in…
Jing9 Aug 27, 2014
b7ded46
HDFS-6920. Archival Storage: check the storage type of delNodeHintSto…
Jing9 Aug 27, 2014
a26aa6b
HDFS-6944. Archival Storage: add retry and termination logic for Move…
Jing9 Aug 27, 2014
3e2a0b5
HDFS-6969. Archival Storage: INode#getStoragePolicyID should always r…
Jing9 Sep 2, 2014
45d5b13
Merge changes from trunk
Jing9 Sep 3, 2014
e08701e
HDFS-6961. Archival Storage: BlockPlacementPolicy#chooseTarget should…
Jing9 Sep 4, 2014
185200e
HDFS-6876. Archival Storage: support set/get storage policy in DFSAdm…
Jing9 Sep 5, 2014
300cb12
Merge trunk into HDFS-6584
Jing9 Sep 5, 2014
54767d3
Fix TestOfflineEditsViewer after merging.
Jing9 Sep 5, 2014
2cd5b4f
HDFS-6979. hdfs.dll not produce .pdb files. Contributed by Chris Naur…
cnauroth Sep 5, 2014
c828b8a
HDFS-6979. Fix minor error in CHANGES.txt. Contributed by Chris Nauroth.
cnauroth Sep 5, 2014
c5ef9c9
HDFS-6862. Add missing timeout annotations to tests. (Contributed by …
arp7 Sep 5, 2014
fc68337
HDFS-6998. warning message 'ssl.client.truststore.location has not be…
arp7 Sep 5, 2014
a149afd
HADOOP-11052. hadoop_verify_secure_prereq's results aren't checked in…
aw-was-here Sep 5, 2014
ba4fc93
HADOOP-11065. Rat check should exclude **/build/**. (kasha)
kambatla Sep 5, 2014
22a41dc
HDFS-6997: add more tests for data migration and replicaion.
Sep 6, 2014
f1432e2
Merge branch 'trunk' into HDFS-6584
Sep 8, 2014
2b5c528
HDFS-6875. Archival Storage: support migration for a list of specifie…
Jing9 Sep 8, 2014
74a7e22
HDFS-7027. Archival Storage: Mover does not terminate when some stora…
Jing9 Sep 8, 2014
867f0f1
HDFS-7029. Archival Storage: fix TestDFSInotifyEventInputStream and T…
Jing9 Sep 8, 2014
6997c1c
Merge remote-tracking branch 'origin/trunk' into HDFS-6584
Jing9 Sep 8, 2014
4124905
HDFS-7028: FSDirectory should not get storage policy id from symlinks
Sep 10, 2014
db41a1b
Merge changes from trunk
Jing9 Sep 10, 2014
70dfe9c
Merge branch 'trunk' into HDFS-6584
Sep 11, 2014
0d85f7e
HDFS-7034. Archival Storage: Fix TestBlockPlacement and TestStorageMo…
Jing9 Sep 11, 2014
8de20a1
Merge trunk into HDFS-6584
Jing9 Sep 11, 2014
dc27ee9
HDFS-7039. Archival Storage: fix Balancer tests. Contributed by Tsz W…
Jing9 Sep 11, 2014
dba52ce
Merge branch 'trunk' into HDFS-6584
Sep 13, 2014
2689b6c
HDFS-7062. Archival Storage: skip under construction block for migrat…
Jing9 Sep 15, 2014
ece3eca
Merge remote-tracking branch 'origin/trunk' into HDFS-6584
Jing9 Sep 15, 2014
2e4033e
HDFS-7052. Archival Storage: Add Mover into hdfs script. Contributed …
Sep 17, 2014
432b863
Merge changes from trunk
Sep 17, 2014
bd2e409
HDFS-7072. Fix TestBlockManager and TestStorageMover. Contributed by…
Sep 17, 2014
aaa7e21
Merge branch 'trunk' into HDFS-6584
Sep 17, 2014
91f6dde
Fix hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt .
Sep 17, 2014
b014e83
HDFS-6864. Archival Storage: add user documentation. Contributed by T…
Sep 17, 2014
e4ddb6d
HADOOP-11099. KMS return HTTP UNAUTHORIZED 401 on ACL failure. (tucu)
Sep 17, 2014
0a495be
HADOOP-11016. KMS should support signing cookies with zookeeper secre…
Sep 17, 2014
d9a8603
HADOOP-10982
Sep 17, 2014
3f8f860
Revert "HADOOP-10982"
Sep 17, 2014
8a7671d
Revert "HADOOP-11016. KMS should support signing cookies with zookeep…
Sep 17, 2014
ea4e2e8
HDFS-6705. Create an XAttr that disallows the HDFS admin from accessi…
umbrant Sep 17, 2014
e3803d0
HDFS-6843. Create FileStatus isEncrypted() method (clamb via cmccabe)
Sep 17, 2014
911979c
Merge changes from trunk
Sep 17, 2014
f24ac42
HDFS-6843. Add to CHANGES.txt
Sep 17, 2014
f230248
HDFS-7075. hadoop-fuse-dfs fails because it cannot find JavaKeyStoreP…
Sep 17, 2014
f488611
YARN-2558. Updated ContainerTokenIdentifier#read/write to use Contain…
jian-he Sep 17, 2014
123f20d
HADOOP-11016. KMS should support signing cookies with zookeeper secre…
Sep 17, 2014
47e5e19
HADOOP-11040. Return value of read(ByteBuffer buf) in CryptoInputStre…
umbrant Sep 18, 2014
bf38793
Move some HDFS JIRAs to the correct CHANGES.txt
umbrant Sep 18, 2014
10e8602
HDFS-7004. Update KeyProvider instantiation to create by URI. (wang)
umbrant Sep 18, 2014
0ecefe6
HDFS-7078. Fix listEZs to work correctly with snapshots. (wang)
umbrant Sep 18, 2014
ee21b13
YARN-2559. Fixed NPE in SystemMetricsPublisher when retrieving FinalA…
jian-he Sep 18, 2014
2d2b000
Merge branch 'trunk' into HDFS-6584
Sep 18, 2014
a3d9934
YARN-1779. Fixed AMRMClient to handle AMRMTokens correctly across Res…
vinoduec Sep 18, 2014
76ccb80
HDFS-7088. Archival Storage: fix TestBalancer and TestBalancerWithMul…
Sep 18, 2014
485c96e
YARN-2001. Added a time threshold for RM to wait before starting cont…
vinoduec Sep 18, 2014
570b8b4
HDFS-7047. Expose FileStatus#isEncrypted in libhdfs (cmccabe)
Sep 18, 2014
9ea7b6c
YARN-2363. Submitted applications occasionally lack a tracking URL. C…
jlowe Sep 18, 2014
474f116
HADOOP-11084 jenkins patchprocess links are broken
steveloughran Sep 18, 2014
1cf3198
MAPREDUCE-6090. mapred hsadmin getGroups fails to connect in some cas…
jlowe Sep 18, 2014
a337f0e
YARN-2561. MR job client cannot reconnect to AM after NM restart. Con…
jlowe Sep 18, 2014
eb92cc6
YARN-2563. Fixed YarnClient to call getTimeLineDelegationToken only i…
jian-he Sep 18, 2014
fe2f54d
HADOOP-11106. Document considerations of HAR and Encryption. (clamb v…
umbrant Sep 18, 2014
70be56d
HDFS-7003. Add NFS Gateway support for reading and writing to encrypt…
umbrant Sep 18, 2014
2c3da25
MAPREDUCE-5891. Improved shuffle error handling across NM restarts. C…
jlowe Sep 18, 2014
1942364
HADOOP-11105. MetricsSystemImpl could leak memory in registered callb…
cnauroth Sep 18, 2014
1b4b460
HADOOP-11105. Update CHANGES.txt.
cnauroth Sep 18, 2014
52945a3
MAPREDUCE-6086. mapreduce.job.credentials.binary should allow all URI…
kambatla Sep 18, 2014
fad4cd8
KMS: Support for multiple Kerberos principals. (tucu)
Sep 18, 2014
98f7bfe
Merge branch 'HDFS-6584' into trunk
Sep 18, 2014
fd3cddf
Fix hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt for HDFS-6584 after
Sep 18, 2014
5d01a68
Revise the HDFS-6584 entry CHANGES.txt.
Sep 18, 2014
fe38d2e
HDFS-6727. Refresh data volumes on DataNode based on configuration ch…
Sep 18, 2014
20a076b
HDFS-6970. Move startFile EDEK retries to the DFSClient. (wang)
umbrant Sep 19, 2014
8e73084
HDFS-6840. Clients are always sent to the same datanode when read is …
umbrant Sep 19, 2014
6434572
HADOOP-11109. Site build is broken. Contributed by Jian He.
atm Sep 19, 2014
6fe5c6b
YARN-2568. Fixed the potential test failures due to race conditions w…
zjshen14 Sep 19, 2014
f02d934
HDFS-6948. DN rejects blocks if it has older UC block. Contributed by
kihwal Sep 19, 2014
bf27b9c
HDFS-7065. Pipeline close recovery race can cause block corruption.
kihwal Sep 19, 2014
25fd69a
HDFS-7096. Fix TestRpcProgramNfs3 to use DFS_ENCRYPTION_KEY_PROVIDER…
Sep 19, 2014
444acf8
YARN-2565. Fixed RM to not use FileSystemApplicationHistoryStore unle…
jian-he Sep 19, 2014
9f03a7c
HADOOP-10946. Fix a bunch of typos in log messages (Ray Chiang via aw)
aw-was-here Sep 19, 2014
951847b
MAPREDUCE-6091. YARNRunner.getJobStatus() fails with ApplicationNotFo…
jlowe Sep 19, 2014
aa1052c
YARN-2460. Remove obsolete entries from yarn-default.xml (Ray Chiang …
aw-was-here Sep 19, 2014
adf0b67
HADOOP-10970. Cleanup KMS configuration keys. (wang)
umbrant Sep 19, 2014
9e35571
HDFS-7046. HA NN can NPE upon transition to active. Contributed by
kihwal Sep 19, 2014
b6ceef9
HADOOP-11112. TestKMSWithZK does not use KEY_PROVIDER_URI. (tucu via …
umbrant Sep 20, 2014
332e2e2
HDFS-7105. Fix TestJournalNode#testFailToStartWithBadConfig to match …
cnauroth Sep 20, 2014
f85cc14
HDFS-7073. Allow falling back to a non-SASL connection on DataTransfe…
cnauroth Sep 20, 2014
db890ee
HADOOP-11017. KMS delegation token secret manager should be able to u…
Sep 20, 2014
84a0a62
HDFS-7095. Archival Storage: TestStorageMover often fails in Jenkins.…
Sep 20, 2014
47491f9
HDFS-7107. Avoid Findbugs warning for synchronization on AbstractNNFa…
cnauroth Sep 21, 2014
0795fe3
HDFS-7109. TestDataStorage does not release file locks between tests.…
cnauroth Sep 21, 2014
b6fd5cc
HDFS-7110. Skip tests related to short-circuit read on platforms that…
cnauroth Sep 21, 2014
c50fc92
YARN-2452. TestRMApplicationHistoryWriter fails with FairScheduler. (…
kambatla Sep 21, 2014
1737950
HDFS-6987. Move CipherSuite xattr information up to the encryption zo…
umbrant Sep 22, 2014
eab15af
HADOOP-10131. NetWorkTopology#countNumOfAvailableNodes() is returning…
vinayakumarb Sep 22, 2014
9721e2c
YARN-2453. TestProportionalCapacityPreemptionPolicy fails with FairSc…
kambatla Sep 22, 2014
7039b98
MAPREDUCE-6095. Enable DistributedCache for uber-mode Jobs. Contribut…
jlowe Sep 22, 2014
26cba7f
HDFS-7115. TestEncryptionZones assumes Unix path separator for KMS ke…
cnauroth Sep 22, 2014
376233c
MAPREDUCE-5279. Made MR headroom calculation honor cpu dimension when…
zjshen14 Sep 22, 2014
0a64149
YARN-1372. Ensure all completed containers are reported to the AMs ac…
jian-he Sep 22, 2014
912ad32
HDFS-7106. Reconfiguring DataNode volumes does not release the lock f…
Sep 22, 2014
23e17ce
YARN-2540. FairScheduler: Queue filters not working on scheduler page…
kambatla Sep 22, 2014
43efdd3
YARN-2539. FairScheduler: Set the default value for maxAMShare to 0.5…
kambatla Sep 22, 2014
7b8df93
HDFS-7001. Tests in TestTracing should not depend on the order of exe…
Sep 23, 2014
a9a55db
YARN-2584. TestContainerManagerSecurity fails on trunk. (Contributed …
JunpingDu Sep 23, 2014
568d3dc
YARN-1959. Fix headroom calculation in FairScheduler. (Anubhav Dhoot …
kambatla Sep 23, 2014
f557820
YARN-2252. Intermittent failure of TestFairScheduler.testContinuousSc…
kambatla Sep 23, 2014
df52fec
HADOOP-11111 MiniKDC to use locale EN_US for case conversions
steveloughran Sep 23, 2014
7aa667e
HADOOP-11111 MiniKDC to use locale EN_US for case conversions: hadoop…
steveloughran Sep 23, 2014
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions dev-support/test-patch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ checkJavadocWarnings () {
JIRA_COMMENT="$JIRA_COMMENT

{color:red}-1 javadoc{color}. The javadoc tool appears to have generated `expr $(($numPatchJavadocWarnings-$numTrunkJavadocWarnings))` warning messages.
See $BUILD_URL/artifact/trunk/patchprocess/diffJavadocWarnings.txt for details."
See $BUILD_URL/artifact/PreCommit-HADOOP-Build-patchprocess/diffJavadocWarnings.txt for details."
return 1
fi
fi
Expand Down Expand Up @@ -498,7 +498,7 @@ checkJavacWarnings () {
{color:red}-1 javac{color}. The applied patch generated $patchJavacWarnings javac compiler warnings (more than the trunk's current $trunkJavacWarnings warnings)."

$DIFF $PATCH_DIR/filteredTrunkJavacWarnings.txt $PATCH_DIR/filteredPatchJavacWarnings.txt > $PATCH_DIR/diffJavacWarnings.txt
JIRA_COMMENT_FOOTER="Javac warnings: $BUILD_URL/artifact/trunk/patchprocess/diffJavacWarnings.txt
JIRA_COMMENT_FOOTER="Javac warnings: $BUILD_URL/artifact/PreCommit-HADOOP-Build-patchprocess/diffJavacWarnings.txt
$JIRA_COMMENT_FOOTER"

return 1
Expand Down Expand Up @@ -540,7 +540,7 @@ checkReleaseAuditWarnings () {
{color:red}-1 release audit{color}. The applied patch generated $patchReleaseAuditWarnings release audit warnings."
$GREP '\!?????' $PATCH_DIR/patchReleaseAuditWarnings.txt > $PATCH_DIR/patchReleaseAuditProblems.txt
echo "Lines that start with ????? in the release audit report indicate files that do not have an Apache license header." >> $PATCH_DIR/patchReleaseAuditProblems.txt
JIRA_COMMENT_FOOTER="Release audit warnings: $BUILD_URL/artifact/trunk/patchprocess/patchReleaseAuditProblems.txt
JIRA_COMMENT_FOOTER="Release audit warnings: $BUILD_URL/artifact/PreCommit-HADOOP-Build-patchprocess/patchReleaseAuditProblems.txt
$JIRA_COMMENT_FOOTER"
return 1
fi
Expand Down Expand Up @@ -659,7 +659,7 @@ checkFindbugsWarnings () {
$PATCH_DIR/newPatchFindbugsWarnings${module_suffix}.xml \
$PATCH_DIR/newPatchFindbugsWarnings${module_suffix}.html
if [[ $newFindbugsWarnings > 0 ]] ; then
JIRA_COMMENT_FOOTER="Findbugs warnings: $BUILD_URL/artifact/trunk/patchprocess/newPatchFindbugsWarnings${module_suffix}.html
JIRA_COMMENT_FOOTER="Findbugs warnings: $BUILD_URL/artifact/PreCommit-HADOOP-Build-patchprocess/newPatchFindbugsWarnings${module_suffix}.html
$JIRA_COMMENT_FOOTER"
fi
done
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,8 @@ public void init(Properties config, ServletContext servletContext,
client = (CuratorFramework) curatorClientObj;
} else {
client = createCuratorClient(config);
servletContext.setAttribute(
ZOOKEEPER_SIGNER_SECRET_PROVIDER_CURATOR_CLIENT_ATTRIBUTE, client);
}
this.tokenValidity = tokenValidity;
shouldDisconnect = Boolean.parseBoolean(
Expand Down
33 changes: 31 additions & 2 deletions hadoop-common-project/hadoop-common/CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,16 @@ Release 2.6.0 - UNRELEASED

HADOOP-10922. User documentation for CredentialShell. (Larry McCay via wang)

HADOOP-11016. KMS should support signing cookies with zookeeper secret
manager. (tucu)

HADOOP-11106. Document considerations of HAR and Encryption. (clamb via wang)

HADOOP-10970. Cleanup KMS configuration keys. (wang)

HADOOP-11017. KMS delegation token secret manager should be able to use
zookeeper as store. (asuresh via tucu)

OPTIMIZATIONS

HADOOP-10838. Byte array native checksumming. (James Thomas via todd)
Expand Down Expand Up @@ -584,6 +594,10 @@ Release 2.6.0 - UNRELEASED

HADOOP-10833. Remove unused cache in UserProvider. (Benoy Antony)

HADOOP-11112. TestKMSWithZK does not use KEY_PROVIDER_URI. (tucu via wang)

HADOOP-11111 MiniKDC to use locale EN_US for case conversions. (stevel)

BUG FIXES

HADOOP-10781. Unportable getgrouplist() usage breaks FreeBSD (Dmitry
Expand Down Expand Up @@ -721,8 +735,8 @@ Release 2.6.0 - UNRELEASED
HADOOP-11056. OsSecureRandom.setConf() might leak file descriptors (yzhang
via cmccabe)

HDFS-6912. SharedFileDescriptorFactory should not allocate sparse files
(cmccabe)
HADOOP-11040. Return value of read(ByteBuffer buf) in CryptoInputStream is
incorrect in some cases. (Yi Liu via wang)

BREAKDOWN OF HDFS-6134 AND HADOOP-10150 SUBTASKS AND RELATED JIRAS

Expand Down Expand Up @@ -824,6 +838,21 @@ Release 2.6.0 - UNRELEASED
HADOOP-11062. CryptoCodec testcases requiring OpenSSL should be run
only if -Pnative is used. (asuresh via tucu)

HADOOP-11099. KMS return HTTP UNAUTHORIZED 401 on ACL failure. (tucu)

HADOOP-11105. MetricsSystemImpl could leak memory in registered callbacks.
(Chuan Liu via cnauroth)

HADOOP-10982. KMS: Support for multiple Kerberos principals. (tucu)

HADOOP-11109. Site build is broken. (Jian He via atm)

HADOOP-10946. Fix a bunch of typos in log messages (Ray Chiang via aw)

HADOOP-10131. NetWorkTopology#countNumOfAvailableNodes() is returning
wrong value if excluded nodes passed are not part of the cluster tree
(vinayakumarb)

Release 2.5.1 - 2014-09-05

INCOMPATIBLE CHANGES
Expand Down
13 changes: 13 additions & 0 deletions hadoop-common-project/hadoop-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,19 @@
<groupId>com.jcraft</groupId>
<artifactId>jsch</artifactId>
</dependency>
<dependency>
<groupId>org.apache.curator</groupId>
<artifactId>curator-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.curator</groupId>
<artifactId>curator-client</artifactId>
</dependency>
<dependency>
<groupId>org.apache.curator</groupId>
<artifactId>curator-recipes</artifactId>
</dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,15 @@ esac
#
# export HADOOP_BALANCER_OPTS=""

###
# HDFS Mover specific parameters
###
# Specify the JVM options to be used when starting the HDFS Mover.
# These options will be appended to the options specified as HADOOP_OPTS
# and therefore may override any similar flags set in HADOOP_OPTS
#
# export HADOOP_MOVER_OPTS=""

###
# Advanced Users Only!
###
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,16 @@ public int read(ByteBuffer buf) throws IOException {
streamOffset += n; // Read n bytes
decrypt(buf, n, pos);
}
return n;

if (n >= 0) {
return unread + n;
} else {
if (unread == 0) {
return -1;
} else {
return unread;
}
}
}

throw new UnsupportedOperationException("ByteBuffer read unsupported " +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ public abstract KeyProvider createProvider(URI providerName,
) throws IOException;

private static final ServiceLoader<KeyProviderFactory> serviceLoader =
ServiceLoader.load(KeyProviderFactory.class);
ServiceLoader.load(KeyProviderFactory.class,
KeyProviderFactory.class.getClassLoader());

// Iterate through the serviceLoader to avoid lazy loading.
// Lazy loading would require synchronization in concurrent use cases.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.lang.reflect.UndeclaredThrowableException;
import java.net.HttpURLConnection;
import java.net.SocketTimeoutException;
import java.net.URI;
Expand Down Expand Up @@ -400,6 +401,8 @@ public HttpURLConnection run() throws Exception {
});
} catch (IOException ex) {
throw ex;
} catch (UndeclaredThrowableException ex) {
throw new IOException(ex.getUndeclaredThrowable());
} catch (Exception ex) {
throw new IOException(ex);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public class FileEncryptionInfo {
private final CipherSuite cipherSuite;
private final byte[] edek;
private final byte[] iv;
private final String keyName;
private final String ezKeyVersionName;

/**
Expand All @@ -42,14 +43,16 @@ public class FileEncryptionInfo {
* @param suite CipherSuite used to encrypt the file
* @param edek encrypted data encryption key (EDEK) of the file
* @param iv initialization vector (IV) used to encrypt the file
* @param keyName name of the key used for the encryption zone
* @param ezKeyVersionName name of the KeyVersion used to encrypt the
* encrypted data encryption key.
*/
public FileEncryptionInfo(final CipherSuite suite, final byte[] edek,
final byte[] iv, final String ezKeyVersionName) {
final byte[] iv, final String keyName, final String ezKeyVersionName) {
checkNotNull(suite);
checkNotNull(edek);
checkNotNull(iv);
checkNotNull(keyName);
checkNotNull(ezKeyVersionName);
checkArgument(edek.length == suite.getAlgorithmBlockSize(),
"Unexpected key length");
Expand All @@ -58,6 +61,7 @@ public FileEncryptionInfo(final CipherSuite suite, final byte[] edek,
this.cipherSuite = suite;
this.edek = edek;
this.iv = iv;
this.keyName = keyName;
this.ezKeyVersionName = ezKeyVersionName;
}

Expand All @@ -83,6 +87,11 @@ public byte[] getIV() {
return iv;
}

/**
* @return name of the encryption zone key.
*/
public String getKeyName() { return keyName; }

/**
* @return name of the encryption zone KeyVersion used to encrypt the
* encrypted data encryption key (EDEK).
Expand All @@ -95,6 +104,7 @@ public String toString() {
builder.append("cipherSuite: " + cipherSuite);
builder.append(", edek: " + Hex.encodeHexString(edek));
builder.append(", iv: " + Hex.encodeHexString(iv));
builder.append(", keyName: " + keyName);
builder.append(", ezKeyVersionName: " + ezKeyVersionName);
builder.append("}");
return builder.toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,15 @@ public long getAccessTime() {
public FsPermission getPermission() {
return permission;
}

/**
* Tell whether the underlying file or directory is encrypted or not.
*
* @return true if the underlying file is encrypted.
*/
public boolean isEncrypted() {
return permission.getEncryptedBit();
}

/**
* Get the owner of the file.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,13 @@ public boolean getAclBit() {
return false;
}

/**
* Returns true if the file is encrypted or directory is in an encryption zone
*/
public boolean getEncryptedBit() {
return false;
}

/** Set the user file creation mask (umask) */
public static void setUMask(Configuration conf, FsPermission umask) {
conf.set(UMASK_LABEL, String.format("%1$03o", umask.toShort()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public VersionMismatchException(byte expectedVersionIn, byte foundVersionIn){
/** Returns a string representation of this object. */
@Override
public String toString(){
return "A record version mismatch occured. Expecting v"
return "A record version mismatch occurred. Expecting v"
+ expectedVersion + ", found v" + foundVersion;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,8 @@ public Object run() throws IOException, InterruptedException {
* a header to the server and starts
* the connection thread that waits for responses.
*/
private synchronized void setupIOstreams() {
private synchronized void setupIOstreams(
AtomicBoolean fallbackToSimpleAuth) {
if (socket != null || shouldCloseConnection.get()) {
return;
}
Expand Down Expand Up @@ -738,11 +739,18 @@ public AuthMethod run()
remoteId.saslQop =
(String)saslRpcClient.getNegotiatedProperty(Sasl.QOP);
LOG.debug("Negotiated QOP is :" + remoteId.saslQop);
} else if (UserGroupInformation.isSecurityEnabled() &&
!fallbackAllowed) {
throw new IOException("Server asks us to fall back to SIMPLE " +
"auth, but this client is configured to only allow secure " +
"connections.");
if (fallbackToSimpleAuth != null) {
fallbackToSimpleAuth.set(false);
}
} else if (UserGroupInformation.isSecurityEnabled()) {
if (!fallbackAllowed) {
throw new IOException("Server asks us to fall back to SIMPLE " +
"auth, but this client is configured to only allow secure " +
"connections.");
}
if (fallbackToSimpleAuth != null) {
fallbackToSimpleAuth.set(true);
}
}
}

Expand Down Expand Up @@ -1375,6 +1383,26 @@ public Writable call(RPC.RpcKind rpcKind, Writable rpcRequest,
/**
* Make a call, passing <code>rpcRequest</code>, to the IPC server defined by
* <code>remoteId</code>, returning the rpc respond.
*
* @param rpcKind
* @param rpcRequest - contains serialized method and method parameters
* @param remoteId - the target rpc server
* @param fallbackToSimpleAuth - set to true or false during this method to
* indicate if a secure client falls back to simple auth
* @returns the rpc response
* Throws exceptions if there are network problems or if the remote code
* threw an exception.
*/
public Writable call(RPC.RpcKind rpcKind, Writable rpcRequest,
ConnectionId remoteId, AtomicBoolean fallbackToSimpleAuth)
throws IOException {
return call(rpcKind, rpcRequest, remoteId, RPC.RPC_SERVICE_CLASS_DEFAULT,
fallbackToSimpleAuth);
}

/**
* Make a call, passing <code>rpcRequest</code>, to the IPC server defined by
* <code>remoteId</code>, returning the rpc response.
*
* @param rpcKind
* @param rpcRequest - contains serialized method and method parameters
Expand All @@ -1386,8 +1414,29 @@ public Writable call(RPC.RpcKind rpcKind, Writable rpcRequest,
*/
public Writable call(RPC.RpcKind rpcKind, Writable rpcRequest,
ConnectionId remoteId, int serviceClass) throws IOException {
return call(rpcKind, rpcRequest, remoteId, serviceClass, null);
}

/**
* Make a call, passing <code>rpcRequest</code>, to the IPC server defined by
* <code>remoteId</code>, returning the rpc response.
*
* @param rpcKind
* @param rpcRequest - contains serialized method and method parameters
* @param remoteId - the target rpc server
* @param serviceClass - service class for RPC
* @param fallbackToSimpleAuth - set to true or false during this method to
* indicate if a secure client falls back to simple auth
* @returns the rpc response
* Throws exceptions if there are network problems or if the remote code
* threw an exception.
*/
public Writable call(RPC.RpcKind rpcKind, Writable rpcRequest,
ConnectionId remoteId, int serviceClass,
AtomicBoolean fallbackToSimpleAuth) throws IOException {
final Call call = createCall(rpcKind, rpcRequest);
Connection connection = getConnection(remoteId, call, serviceClass);
Connection connection = getConnection(remoteId, call, serviceClass,
fallbackToSimpleAuth);
try {
connection.sendRpcRequest(call); // send the rpc request
} catch (RejectedExecutionException e) {
Expand Down Expand Up @@ -1444,7 +1493,8 @@ Set<ConnectionId> getConnectionIds() {
/** Get a connection from the pool, or create a new one and add it to the
* pool. Connections to a given ConnectionId are reused. */
private Connection getConnection(ConnectionId remoteId,
Call call, int serviceClass) throws IOException {
Call call, int serviceClass, AtomicBoolean fallbackToSimpleAuth)
throws IOException {
if (!running.get()) {
// the client is stopped
throw new IOException("The client is stopped");
Expand All @@ -1468,7 +1518,7 @@ private Connection getConnection(ConnectionId remoteId,
//block above. The reason for that is if the server happens to be slow,
//it will take longer to establish a connection and that will slow the
//entire system down.
connection.setupIOstreams();
connection.setupIOstreams(fallbackToSimpleAuth);
return connection;
}

Expand Down
Loading