[
https://issues.apache.org/jira/browse/JENA-1122?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15136986#comment-15136986
]
ASF GitHub Bot commented on JENA-1122:
--------------------------------------
Github user ajs6f commented on a diff in the pull request:
https://github.com/apache/jena/pull/123#discussion_r52172791
--- Diff:
jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/build/DescriptionToDatasetMap.java
---
@@ -0,0 +1,48 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.fuseki.build;
+
+import org.apache.jena.query.Dataset;
+import org.apache.jena.rdf.model.Resource;
+
+/**
+ * Map from configuration Resources in an RDF graph to dataset objects.
+ *
+ * <p>
+ * Provides a singleton for use in building the Fuseki configuration to
+ * ensure that each dataset description resource in configuration graphs
+ * corresponds to one dataset object when multiple services refer to the
+ * same dataset.
+ * </p>
+ *
+ *
+ */
+public class DescriptionToDatasetMap {
+
+ private final static DescriptionToDatasetMap singleton = new
DescriptionToDatasetMap();
+
+ public static DescriptionToDatasetMap getSingleton() { return singleton
; }
+
+ private RefCountingMap<Resource, Dataset> map = new
RefCountingMap<Resource,Dataset>();
--- End diff --
A small thing, but you can use `new RefCountingMap<>()` here.
> Fuseki fails to start if configured with two services that share the same
> dataset with a lucene index.
> ------------------------------------------------------------------------------------------------------
>
> Key: JENA-1122
> URL: https://issues.apache.org/jira/browse/JENA-1122
> Project: Apache Jena
> Issue Type: Bug
> Components: Text
> Affects Versions: Jena 3.0.0, Fuseki 2.3.0
> Reporter: Brian McBride
>
> This problem arises when the assemblers for the two services run. For each
> service, a separate TextIndexLucene object is created. Both of those objects
> try to lock the same Lucene index directory and one fails.
> A proposed fix is to modify the TextDatasetFactory to only create one
> TextIndexLucene object per on disk directory.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)