mirror of
https://github.com/Alfresco/SearchServices.git
synced 2025-09-17 14:21:20 +00:00
[SEARCH-1994]
workaroung for open contentstore file descriptors in windows os
This commit is contained in:
@@ -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);
|
||||||
}
|
}
|
||||||
|
@@ -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));
|
||||||
|
@@ -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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user