This is an automated email from the ASF dual-hosted git repository. mblow pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/asterixdb.git
commit 4bf65035dd13ad6b5a621adee92271176f81ba1b Merge: 855f7e2f7d 47aa7a5cc3 Author: Michael Blow <[email protected]> AuthorDate: Sun May 21 16:44:57 2023 -0400 Merge branch 'gerrit/neo' Change-Id: I61914fe1f789813b96c2b0af0ff744ac87fa47ba .../message/RegistrationTasksResponseMessage.java | 3 ++ .../asterix/app/translator/QueryTranslator.java | 25 ++++++++++---- .../org/apache/asterix/utils/RebalanceUtil.java | 2 ++ .../asterix/common/metadata/IMetadataLock.java | 2 +- .../apache/asterix/common/metadata/LockList.java | 7 +++- .../asterix/common/utils/NcLocalCounters.java | 8 +++++ .../apache/asterix/metadata/lock/DatasetLock.java | 20 ++++++++--- .../transaction/GlobalResourceIdFactory.java | 39 +++++++++++++++++++--- .../PersistentLocalResourceRepository.java | 5 ++- .../hyracks/control/cc/work/NodeHeartbeatWork.java | 8 +++-- .../storage/common/buffercache/BufferCache.java | 4 ++- .../storage/common/file/IResourceIdFactory.java | 10 ++++-- .../hyracks/storage/common/BufferCacheTest.java | 24 ++++++++++++- 13 files changed, 130 insertions(+), 27 deletions(-) diff --cc asterixdb/asterix-transactions/src/main/java/org/apache/asterix/transaction/management/resource/PersistentLocalResourceRepository.java index 8ef55e89f2,f9bf175d93..080204eb0a --- a/asterixdb/asterix-transactions/src/main/java/org/apache/asterix/transaction/management/resource/PersistentLocalResourceRepository.java +++ b/asterixdb/asterix-transactions/src/main/java/org/apache/asterix/transaction/management/resource/PersistentLocalResourceRepository.java @@@ -236,16 -241,22 +236,19 @@@ public class PersistentLocalResourceRep return ioManager.resolve(fileName); } - public synchronized Map<Long, LocalResource> getResources(Predicate<LocalResource> filter, List<Path> roots) - throws HyracksDataException { + public synchronized Map<Long, LocalResource> getResources(Predicate<LocalResource> filter, + List<FileReference> roots) throws HyracksDataException { Map<Long, LocalResource> resourcesMap = new HashMap<>(); - for (Path root : roots) { - if (!Files.exists(root) || !Files.isDirectory(root)) { - continue; - } - final Collection<File> files = IoUtil.getMatchingFiles(root, METADATA_FILES_FILTER); + for (FileReference root : roots) { + final Collection<FileReference> files = ioManager.getMatchingFiles(root, METADATA_FILES_FILTER); try { - for (File file : files) { + for (FileReference file : files) { final LocalResource localResource = readLocalResource(file); - if (filter.test(localResource)) { + if (localResource != null && filter.test(localResource)) { - resourcesMap.put(localResource.getId(), localResource); + LocalResource duplicate = resourcesMap.putIfAbsent(localResource.getId(), localResource); + if (duplicate != null) { + LOGGER.warn("found duplicate resource ids {} and {}", localResource, duplicate); + } } } } catch (IOException e) {
