mirror of https://github.com/apache/lucene.git
SOLR-6305: Replication from filesysem defaults, not from server defaults
Signed-off-by: Kevin Risden <krisden@apache.org>
This commit is contained in:
parent
c69548d39f
commit
858b97a144
|
@ -62,6 +62,8 @@ Improvements
|
|||
|
||||
* SOLR-13558: Allow dynamic resizing of SolrCache-s. (ab)
|
||||
|
||||
* SOLR-6305: Ability to set the replication factor for index files created by HDFSDirectoryFactory (Boris Pasko via Kevin Risden)
|
||||
|
||||
Bug Fixes
|
||||
----------------------
|
||||
|
||||
|
|
|
@ -43,6 +43,7 @@ public class HdfsFileWriter extends OutputStreamIndexOutput {
|
|||
private static final OutputStream getOutputStream(FileSystem fileSystem, Path path) throws IOException {
|
||||
Configuration conf = fileSystem.getConf();
|
||||
FsServerDefaults fsDefaults = fileSystem.getServerDefaults(path);
|
||||
short replication = fileSystem.getDefaultReplication(path);
|
||||
EnumSet<CreateFlag> flags = EnumSet.of(CreateFlag.CREATE,
|
||||
CreateFlag.OVERWRITE);
|
||||
if (Boolean.getBoolean(HDFS_SYNC_BLOCK)) {
|
||||
|
@ -50,7 +51,7 @@ public class HdfsFileWriter extends OutputStreamIndexOutput {
|
|||
}
|
||||
return fileSystem.create(path, FsPermission.getDefault()
|
||||
.applyUMask(FsPermission.getUMask(conf)), flags, fsDefaults
|
||||
.getFileBufferSize(), fsDefaults.getReplication(), fsDefaults
|
||||
.getFileBufferSize(), replication, fsDefaults
|
||||
.getBlockSize(), null);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue