Skip to content
Permalink
Browse files

Updating configs, fixing len/newlen bug in CacheLoaderChunkInputStrea…

…m and updating JQL query in JQLConverterIT
  • Loading branch information...
escowles committed Aug 6, 2014
1 parent 9915c50 commit d9d378392bc0ffa4678dc370426964cbdf041373
@@ -1,6 +1,6 @@
<infinispan xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:infinispan:config:5.2 http://www.infinispan.org/schemas/infinispan-config-5.2.xsd"
xmlns="urn:infinispan:config:5.2">
xsi:schemaLocation="urn:infinispan:config:6.0 http://www.infinispan.org/schemas/infinispan-config-6.0.xsd"
xmlns="urn:infinispan:config:6.0">

<global>

@@ -1,6 +1,6 @@
<infinispan xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:infinispan:config:5.2 http://www.infinispan.org/schemas/infinispan-config-5.2.xsd"
xmlns="urn:infinispan:config:5.2">
xsi:schemaLocation="urn:infinispan:config:6.0 http://www.infinispan.org/schemas/infinispan-config-6.0.xsd"
xmlns="urn:infinispan:config:6.0">

<global>
<globalJmxStatistics enabled="true" allowDuplicateDomains="true"/>
@@ -1,13 +1,14 @@
<infinispan xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:infinispan:config:5.2 http://www.infinispan.org/schemas/infinispan-config-5.2.xsd"
xmlns="urn:infinispan:config:5.2">
xmlns="urn:infinispan:config:6.0"
xmlns:store="urn:infinispan:config:store:leveldb:6.0"
xsi:schemaLocation="urn:infinispan:config:6.0 http://www.infinispan.org/schemas/infinispan-config-6.0.xsd urn:infinispan:config:store:leveldb:6.0 http://infinispan.org/schemas/infinispan-cachestore-leveldb-config-6.0.xsd">
<global>
<globalJmxStatistics enabled="false" allowDuplicateDomains="true"/>
</global>

<default>
<expiration wakeUpInterval="-1" />
<unsafe unreliableReturnValues="true" />
<unsafe unreliableReturnValues="true" />
</default>

<namedCache name="FedoraRepository">
@@ -16,22 +17,17 @@

<transaction
transactionManagerLookupClass="org.infinispan.transaction.lookup.GenericTransactionManagerLookup"
transactionMode="TRANSACTIONAL" lockingMode="PESSIMISTIC"/>
transactionMode="TRANSACTIONAL"
lockingMode="PESSIMISTIC"/>

<!-- Define the cache loaders (i.e., cache stores). Passivation is false
because we want *all* data to be persisted, not just what doesn't fit
into memory. Shared is false because there are no other caches sharing
this file store. We set preload to false for lazy loading; may be
improved by preloading and configuring eviction. We can have multiple
cache loaders, which get chained. But we'll define just one. -->

<loaders passivation="false" shared="false" preload="false">
<leveldbStore xmlns="urn:infinispan:config:leveldb:5.2"
fetchPersistentState="true"
into memory. -->
<persistence passivation="false">
<store:leveldbStore
location="${fcrepo.ispn.repo.CacheDirPath:target}/data"
expiredLocation="${fcrepo.ispn.repo.CacheDirPath:target}/expired">
</leveldbStore>
</loaders>
expiredLocation="${fcrepo.ispn.repo.CacheDirPath:target}/expired"/>
</persistence>

</namedCache>

@@ -27,7 +27,7 @@
-->

<loaders passivation="false" shared="false" preload="false">
<leveldbStore xmlns="urn:infinispan:config:leveldb:5.2"
<leveldbStore xmlns="urn:infinispan:config:leveldb:6.0"
location="${fcrepo.ispn.repo.CacheDirPath:target/repo}/data"
expiredLocation="${fcrepo.ispn.repo.CacheDirPath:target/repo}/expired"
/>
@@ -52,7 +52,7 @@
-->

<loaders passivation="false" shared="false" preload="false">
<leveldbStore xmlns="urn:infinispan:config:leveldb:5.2"
<leveldbStore xmlns="urn:infinispan:config:leveldb:6.0"
location="${fcrepo.ispn.CacheDirPath:target}/data"
expiredLocation="${fcrepo.ispn.CacheDirPath:target}/expired"
/>
@@ -1,6 +1,6 @@
<infinispan xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:infinispan:config:5.2 http://www.infinispan.org/schemas/infinispan-config-5.2.xsd"
xmlns="urn:infinispan:config:5.2">
xsi:schemaLocation="urn:infinispan:config:6.0 http://www.infinispan.org/schemas/infinispan-config-6.0.xsd"
xmlns="urn:infinispan:config:6.0">

<global>
<globalJmxStatistics enabled="true" allowDuplicateDomains="true"/>
@@ -6,20 +6,6 @@
"default" : "default",
"allowCreation" : true
},
"query" : {
"enabled" : "${fcrepo.modeshape.query.enabled:true}",
"indexStorage" : {
"type" : "filesystem",
"location" : "${fcrepo.modeshape.index.location:target/indexes}",
"lockingStrategy" : "native",
"fileSystemAccessType" : "auto"
},
"rebuildUponStartup" : "if_missing",

"indexing" : {
"mode" : "${fcrepo.modeshape.query.mode:sync}"
}
},
"storage" : {
"cacheName" : "FedoraRepository",
"cacheConfiguration" : "${fcrepo.infinispan.cache_configuration:config/infinispan/leveldb-default/infinispan.xml}",
@@ -95,12 +95,12 @@ public int read( final byte[] b,
} else {
newlen = len;
}
System.arraycopy(buffer, indexInBuffer, b, off, len);
indexInBuffer += len;
System.arraycopy(buffer, indexInBuffer, b, off, newlen);
indexInBuffer += newlen;
if (indexInBuffer >= buffer.length) {
fillBufferWithNextChunk();
}
return len;
return newlen;
}

@Override
@@ -107,7 +107,7 @@
* A Fedora datastream.
*/
[fedora:datastream] > fedora:resource mixin
+ image:metadata (nt:unstructured) multiple
+ image:metadata (nt:unstructured) SNS

/*
* Some content that can have a checksum
@@ -1,153 +1,62 @@
<infinispan xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:infinispan:config:5.2 http://www.infinispan.org/schemas/infinispan-config-5.2.xsd"
xmlns="urn:infinispan:config:5.2">
xmlns="urn:infinispan:config:6.0"
xsi:schemaLocation="urn:infinispan:config:6.0 http://www.infinispan.org/schemas/infinispan-config-6.0.xsd">

<global>
<globalJmxStatistics enabled="true" allowDuplicateDomains="true"/>
<globalJmxStatistics enabled="false" allowDuplicateDomains="true"/>
</global>

<default>
</default>


<namedCache name="FedoraRepository">

<eviction maxEntries="500" strategy="LIRS" threadPolicy="DEFAULT"/>

<transaction
transactionManagerLookupClass="org.infinispan.transaction.lookup.GenericTransactionManagerLookup"
transactionMode="TRANSACTIONAL" lockingMode="PESSIMISTIC"/>
<!--
Define the cache loaders (i.e., cache stores). Passivation is false because we want *all*
data to be persisted, not just what doesn't fit into memory. Shared is false because there
are no other caches sharing this file store. We set preload to false for lazy loading;
may be improved by preloading and configuring eviction.
We can have multiple cache loaders, which get chained. But we'll define just one.
-->

<loaders passivation="false" shared="false" preload="false">
transactionMode="TRANSACTIONAL"
lockingMode="OPTIMISTIC"/>

<persistence passivation="false">
<singleFile shared="false"
preload="false"
fetchPersistentState="false"
purgeOnStartup="false"
location="target/fedora_repository/store">
</singleFile>
</persistence>

<!--
The 'fetchPersistentState' attribute applies when this cache joins the cluster; the value doesn't
really matter to us in this case. See the documentation for more options.
-->
<loader class="org.infinispan.loaders.file.FileCacheStore" fetchPersistentState="true"
purgeOnStartup="false">
<!-- See the documentation for more configuration examples and flags. -->
<properties>
<!-- We have to set the location where we want to store the data. -->
<property name="location" value="${fcrepo.ispn.repo.CacheDirPath:target/FedoraRepository/storage}"/>

<property name="fsyncMode" value="perWrite"/>
</properties>
<!-- This repository isn't clustered, so we could set up the SingletonStore.
singletonStore enabled="true" pushStateWhenCoordinator="true" pushStateTimeout="20000"/>
-->
<!--
We could use "write-behind", which actually writes to the file system asynchronously,
which can improve performance as seen by the JCR client.
Plus changes are coalesced, meaning that if multiple changes are enqueued for the
same node, only the last one is written. (This is good much of the time, but not
always.)
<async enabled="true" flushLockTimeout="15000" threadPoolSize="5"/>
-->
</loader>

</loaders>
</namedCache>

<namedCache name="FedoraRepositoryMetaData">

<eviction maxEntries="500" strategy="LIRS" threadPolicy="DEFAULT"/>

<transaction
transactionManagerLookupClass="org.infinispan.transaction.lookup.GenericTransactionManagerLookup"
transactionMode="TRANSACTIONAL" lockingMode="PESSIMISTIC"/>
<!--
Define the cache loaders (i.e., cache stores). Passivation is false because we want *all*
data to be persisted, not just what doesn't fit into memory. Shared is false because there
are no other caches sharing this file store. We set preload to false for lazy loading;
may be improved by preloading and configuring eviction.
We can have multiple cache loaders, which get chained. But we'll define just one.
-->
transactionMode="TRANSACTIONAL"
lockingMode="OPTIMISTIC"/>

<persistence passivation="false">
<singleFile shared="false"
preload="false"
fetchPersistentState="false"
purgeOnStartup="false"
location="target/fedora_repository/md_store">
</singleFile>
</persistence>

<loaders passivation="false" shared="false" preload="false">

<!--
The 'fetchPersistentState' attribute applies when this cache joins the cluster; the value doesn't
really matter to us in this case. See the documentation for more options.
-->
<loader class="org.infinispan.loaders.file.FileCacheStore" fetchPersistentState="true"
purgeOnStartup="false">
<!-- See the documentation for more configuration examples and flags. -->
<properties>
<!-- We have to set the location where we want to store the data. -->
<property name="location" value="${fcrepo.ispn.CacheDirPath:target/FedoraRepositoryMetaData/storage}"/>

<property name="fsyncMode" value="perWrite"/>
</properties>
<!-- This repository isn't clustered, so we could set up the SingletonStore.
singletonStore enabled="true" pushStateWhenCoordinator="true" pushStateTimeout="20000"/>
-->
<!--
We could use "write-behind", which actually writes to the file system asynchronously,
which can improve performance as seen by the JCR client.
Plus changes are coalesced, meaning that if multiple changes are enqueued for the
same node, only the last one is written. (This is good much of the time, but not
always.)
<async enabled="true" flushLockTimeout="15000" threadPoolSize="5"/>
-->
</loader>

</loaders>
</namedCache>

<namedCache name="FedoraRepositoryBinaryData">

<eviction maxEntries="100" strategy="LIRS" threadPolicy="DEFAULT"/>

<transaction
transactionManagerLookupClass="org.infinispan.transaction.lookup.GenericTransactionManagerLookup"
transactionMode="TRANSACTIONAL" lockingMode="PESSIMISTIC"/>
<!--
Define the cache loaders (i.e., cache stores). Passivation is false because we want *all*
data to be persisted, not just what doesn't fit into memory. Shared is false because there
are no other caches sharing this file store. We set preload to false for lazy loading;
may be improved by preloading and configuring eviction.
We can have multiple cache loaders, which get chained. But we'll define just one.
-->

<loaders passivation="false" shared="false" preload="false">

<!--
The 'fetchPersistentState' attribute applies when this cache joins the cluster; the value doesn't
really matter to us in this case. See the documentation for more options.
-->
<loader class="org.infinispan.loaders.file.FileCacheStore" fetchPersistentState="true"
purgeOnStartup="false">
<!-- See the documentation for more configuration examples and flags. -->
<properties>
<!-- We have to set the location where we want to store the data. -->
<property name="location" value="${fcrepo.ispn.binary.CacheDirPath:target/FedoraRepositoryBinaryData/storage}"/>

<property name="fsyncMode" value="perWrite"/>
</properties>
<!-- This repository isn't clustered, so we could set up the SingletonStore.
singletonStore enabled="true" pushStateWhenCoordinator="true" pushStateTimeout="20000"/>
-->
<!--
We could use "write-behind", which actually writes to the file system asynchronously,
which can improve performance as seen by the JCR client.
Plus changes are coalesced, meaning that if multiple changes are enqueued for the
same node, only the last one is written. (This is good much of the time, but not
always.)
<async enabled="true" flushLockTimeout="15000" threadPoolSize="5"/>
-->
</loader>
transactionMode="TRANSACTIONAL"
lockingMode="OPTIMISTIC"/>

<persistence passivation="false">
<singleFile shared="false"
preload="false"
fetchPersistentState="false"
purgeOnStartup="false"
location="target/fedora_repository/bin_store">
</singleFile>
</persistence>

</loaders>
</namedCache>
</infinispan>
@@ -1,6 +1,6 @@
<infinispan xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:infinispan:config:5.2 http://www.infinispan.org/schemas/infinispan-config-5.2.xsd"
xmlns="urn:infinispan:config:5.2">
xsi:schemaLocation="urn:infinispan:config:6.0 http://www.infinispan.org/schemas/infinispan-config-6.0.xsd"
xmlns="urn:infinispan:config:6.0">

<global>
<globalJmxStatistics allowDuplicateDomains="true" />
@@ -1,6 +1,6 @@
<infinispan xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:infinispan:config:5.2 http://www.infinispan.org/schemas/infinispan-config-5.2.xsd"
xmlns="urn:infinispan:config:5.2">
xsi:schemaLocation="urn:infinispan:config:6.0 http://www.infinispan.org/schemas/infinispan-config-6.0.xsd"
xmlns="urn:infinispan:config:6.0">

<global>

@@ -286,17 +286,17 @@ public void testComplexQuery() throws RepositoryException {

final String namespacePrefix = session.getNamespacePrefix("http://libraries.ucsd.edu/ark:/20775/");

final String expectedQuery =
"SELECT DISTINCT [fedoraResource_subject].[jcr:path] AS subject, " +
"[fedoraResource_subject].[ns001:bb3652744n] AS object FROM [fedora:resource] AS " +
"[fedoraResource_subject] WHERE ((([fedoraResource_subject].[ns001:bb2765355h] = " +
"'bf2765355h' AND [fedoraResource_subject].[ns001:bb3652744n] IS NOT NULL) AND " +
"[fedoraResource_subject].[ns001:bb3652744n] LIKE 'r') AND " +
"(([fedoraResource_subject].[ns001:bb3652744n] >= 'abc' AND " +
"[fedoraResource_subject].[ns001:bb3652744n] < 'efg') OR NOT " +
"([fedoraResource_subject].[ns001:bb3652744n] = 'efg'))) ORDER BY " +
"[fedoraResource_subject].[jcr:path] DESC, " +
"[fedoraResource_subject].[ns001:bb3652744n] ASC LIMIT 10 OFFSET 20";
final String expectedQuery = "SELECT DISTINCT [fedoraResource_subject].[jcr:path] AS subject, " +
"[fedoraResource_subject].[ns001:bb3652744n] AS object " +
"FROM [fedora:resource] AS [fedoraResource_subject] " +
"WHERE ((([fedoraResource_subject].[ns001:bb2765355h] = 'bf2765355h' AND " +
"[fedoraResource_subject].[ns001:bb3652744n] IS NOT NULL) AND " +
"[fedoraResource_subject].[ns001:bb3652744n] LIKE 'r') AND " +
"(([fedoraResource_subject].[ns001:bb3652744n] >= 'abc' AND " +
"[fedoraResource_subject].[ns001:bb3652744n] < 'efg') OR NOT " +
"([fedoraResource_subject].[ns001:bb3652744n] = 'efg'))) " +
"ORDER BY [fedoraResource_subject].[jcr:path] DESC NULLS FIRST, " +
"[fedoraResource_subject].[ns001:bb3652744n] ASC NULLS LAST LIMIT 10 OFFSET 20";

assertEquals(expectedQuery.replaceAll("ns001", namespacePrefix), statement);
}

0 comments on commit d9d3783

Please sign in to comment.
You can’t perform that action at this time.