[SEARCH-1994]

workaroung for open contentstore file descriptors in windows os
This commit is contained in:
eliaporciani
2019-12-17 17:08:33 +01:00
parent a800aeb21c
commit f45dbaa85f
3 changed files with 8 additions and 3 deletions

View File

@@ -49,6 +49,7 @@ import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.function.Predicate;
import java.util.stream.Stream;
import java.util.zip.GZIPInputStream;
import java.util.zip.GZIPOutputStream;
@@ -234,10 +235,9 @@ public final class SolrContentStore implements Closeable, AccessMode
@Override
public long getLastCommittedVersion()
{
try
try(Stream<String> fileStream = Files.lines(Paths.get(root, ".version")) )
{
return Files.lines(Paths.get(root, ".version"))
.map(Long::parseLong)
return fileStream.map(Long::parseLong)
.findFirst()
.orElse(NO_VERSION_AVAILABLE);
}

View File

@@ -467,6 +467,8 @@ class AlfrescoIndexFetcher
Map<String, List<Map<String, Object>>> contentStoreMap = (Map<String, List<Map<String, Object>>>) response
.get(CONTENT_STORE_FILES);
fullContentStoreReplication = false;
if (contentStoreMap != null)
{
contentStoreFilesToDownload = Collections.synchronizedList(contentStoreMap.get(SolrContentStore.ADDS));

View File

@@ -2122,6 +2122,7 @@ public class AlfrescoReplicationHandler extends RequestHandlerBase implements So
e.printStackTrace();
}
}
}
}
catch (Exception e)
@@ -2169,6 +2170,7 @@ public class AlfrescoReplicationHandler extends RequestHandlerBase implements So
if (bytesRead <= 0)
{
writeNothingAndFlush();
inputStream.close();
break;
}
@@ -2185,6 +2187,7 @@ public class AlfrescoReplicationHandler extends RequestHandlerBase implements So
fos.flush();
}
}
}
}
}