[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.Locale;
import java.util.Map; import java.util.Map;
import java.util.function.Predicate; import java.util.function.Predicate;
import java.util.stream.Stream;
import java.util.zip.GZIPInputStream; import java.util.zip.GZIPInputStream;
import java.util.zip.GZIPOutputStream; import java.util.zip.GZIPOutputStream;
@@ -234,10 +235,9 @@ public final class SolrContentStore implements Closeable, AccessMode
@Override @Override
public long getLastCommittedVersion() public long getLastCommittedVersion()
{ {
try try(Stream<String> fileStream = Files.lines(Paths.get(root, ".version")) )
{ {
return Files.lines(Paths.get(root, ".version")) return fileStream.map(Long::parseLong)
.map(Long::parseLong)
.findFirst() .findFirst()
.orElse(NO_VERSION_AVAILABLE); .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 Map<String, List<Map<String, Object>>> contentStoreMap = (Map<String, List<Map<String, Object>>>) response
.get(CONTENT_STORE_FILES); .get(CONTENT_STORE_FILES);
fullContentStoreReplication = false;
if (contentStoreMap != null) if (contentStoreMap != null)
{ {
contentStoreFilesToDownload = Collections.synchronizedList(contentStoreMap.get(SolrContentStore.ADDS)); contentStoreFilesToDownload = Collections.synchronizedList(contentStoreMap.get(SolrContentStore.ADDS));

View File

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