SOLR-4033: Consistently use the solrconfig.xml lockType everywhere.

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1418712 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Mark Robert Miller 2012-12-08 17:16:04 +00:00
parent 27e2737ab2
commit 82d0ed529a
6 changed files with 13 additions and 11 deletions

View File

@ -72,7 +72,9 @@ New Features
Additional Work:
- SOLR-4032: Files larger than an internal buffer size fail to replicate.
(Mark Miller, Markus Jelsma)
- SOLR-4033: Consistently use the solrconfig.xml lockType everywhere.
(Mark Miller, Markus Jelsma)
* SOLR-1972: Add extra statistics to RequestHandlers - 5 & 15-minute reqs/sec
rolling averages; median, 75th, 95th, 99th, 99.9th percentile request times
(Alan Woodward, Shawn Heisey, Adrien Grand)

View File

@ -235,7 +235,7 @@ public final class SolrCore implements SolrInfoMBean {
Properties p = new Properties();
Directory dir = null;
try {
dir = getDirectoryFactory().get(getDataDir(), null);
dir = getDirectoryFactory().get(getDataDir(), getSolrConfig().indexConfig.lockType);
if (dir.fileExists("index.properties")){
final IndexInput input = dir.openInput("index.properties", IOContext.DEFAULT);

View File

@ -361,7 +361,7 @@ public class ReplicationHandler extends RequestHandlerBase implements SolrCoreAw
// use a set to workaround possible Lucene bug which returns same file
// name multiple times
Collection<String> files = new HashSet<String>(commit.getFileNames());
dir = core.getDirectoryFactory().get(core.getNewIndexDir(), null);
dir = core.getDirectoryFactory().get(core.getNewIndexDir(), core.getSolrConfig().indexConfig.lockType);
try {
for (String fileName : files) {
@ -467,7 +467,7 @@ public class ReplicationHandler extends RequestHandlerBase implements SolrCoreAw
Directory dir;
long size = 0;
try {
dir = core.getDirectoryFactory().get(core.getNewIndexDir(), null);
dir = core.getDirectoryFactory().get(core.getNewIndexDir(), core.getSolrConfig().indexConfig.lockType);
try {
size = DirectoryFactory.sizeOfDirectory(dir);
} finally {

View File

@ -371,10 +371,10 @@ public class SnapPuller {
String tmpIdxDirName = "index." + new SimpleDateFormat(SnapShooter.DATE_FMT, Locale.ROOT).format(new Date());
tmpIndex = createTempindexDir(core, tmpIdxDirName);
tmpIndexDir = core.getDirectoryFactory().get(tmpIndex, null);
tmpIndexDir = core.getDirectoryFactory().get(tmpIndex, core.getSolrConfig().indexConfig.lockType);
// make sure it's the newest known index dir...
indexDir = core.getDirectoryFactory().get(core.getNewIndexDir(), null);
indexDir = core.getDirectoryFactory().get(core.getNewIndexDir(), core.getSolrConfig().indexConfig.lockType);
Directory oldDirectory = null;
try {
@ -709,7 +709,7 @@ public class SnapPuller {
String indexDir = solrCore.getIndexDir();
// it's okay to use null for lock factory since we know this dir will exist
Directory dir = solrCore.getDirectoryFactory().get(indexDir, null);
Directory dir = solrCore.getDirectoryFactory().get(indexDir, solrCore.getSolrConfig().indexConfig.lockType);
try {
for (Map<String,Object> file : filesToDownload) {
if (!dir.fileExists((String) file.get(NAME)) || downloadCompleteIndex) {
@ -832,7 +832,7 @@ public class SnapPuller {
Properties p = new Properties();
Directory dir = null;
try {
dir = solrCore.getDirectoryFactory().get(solrCore.getDataDir(), null);
dir = solrCore.getDirectoryFactory().get(solrCore.getDataDir(), solrCore.getSolrConfig().indexConfig.lockType);
if (dir.fileExists("index.properties")){
final IndexInput input = dir.openInput("index.properties", IOContext.DEFAULT);

View File

@ -101,7 +101,7 @@ public class SnapShooter {
Collection<String> files = indexCommit.getFileNames();
FileCopier fileCopier = new FileCopier();
Directory dir = solrCore.getDirectoryFactory().get(solrCore.getIndexDir(), null);
Directory dir = solrCore.getDirectoryFactory().get(solrCore.getIndexDir(), solrCore.getSolrConfig().indexConfig.lockType);
try {
fileCopier.copyFiles(dir, files, snapShotDir);
} finally {

View File

@ -613,7 +613,7 @@ public class CoreAdminHandler extends RequestHandlerBase {
public void postClose(SolrCore core) {
Directory dir = null;
try {
dir = core.getDirectoryFactory().get(core.getIndexDir(), null);
dir = core.getDirectoryFactory().get(core.getIndexDir(), core.getSolrConfig().indexConfig.lockType);
core.getDirectoryFactory().remove(dir);
core.getDirectoryFactory().doneWithDirectory(dir);
} catch (IOException e) {
@ -1015,7 +1015,7 @@ public class CoreAdminHandler extends RequestHandlerBase {
Directory dir;
long size = 0;
try {
dir = core.getDirectoryFactory().get(core.getIndexDir(), null);
dir = core.getDirectoryFactory().get(core.getIndexDir(), core.getSolrConfig().indexConfig.lockType);
try {
size = DirectoryFactory.sizeOfDirectory(dir);
} finally {