svn commit: r1605687 - /jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/run/Main.java
Author: mreutegg Date: Thu Jun 26 07:52:43 2014 New Revision: 1605687 URL: http://svn.apache.org/r1605687 Log: OAK-1919: Use 127.0.0.1 as default for MongoDB host Modified: jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/run/Main.java Modified: jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/run/Main.java URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/run/Main.java?rev=1605687&r1=1605686&r2=1605687&view=diff == --- jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/run/Main.java (original) +++ jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/run/Main.java Thu Jun 26 07:52:43 2014 @@ -430,7 +430,7 @@ public class Main { OptionSpec mmap = parser.accepts("mmap", "TarMK memory mapping").withOptionalArg().ofType(Boolean.class).defaultsTo("64".equals(System.getProperty("sun.arch.data.model"))); // mongo specific options: -OptionSpec host = parser.accepts("host", "MongoDB host").withRequiredArg().defaultsTo("localhost"); +OptionSpec host = parser.accepts("host", "MongoDB host").withRequiredArg().defaultsTo("127.0.0.1"); OptionSpec port = parser.accepts("port", "MongoDB port").withRequiredArg().ofType(Integer.class).defaultsTo(27017); OptionSpec dbName = parser.accepts("db", "MongoDB database").withRequiredArg(); OptionSpec clusterIds = parser.accepts("clusterIds", "Cluster Ids").withOptionalArg().ofType(Integer.class).withValuesSeparatedBy(',');
svn commit: r1605725 - /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/SegmentId.java
Author: alexparvulescu Date: Thu Jun 26 10:22:23 2014 New Revision: 1605725 URL: http://svn.apache.org/r1605725 Log: OAK-1915 TarMK failover 2.0 - made the SegmentId constructors public Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/SegmentId.java Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/SegmentId.java URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/SegmentId.java?rev=1605725&r1=1605724&r2=1605725&view=diff == --- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/SegmentId.java (original) +++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/SegmentId.java Thu Jun 26 10:22:23 2014 @@ -46,14 +46,14 @@ public class SegmentId implements Compar private volatile Segment segment; -SegmentId(SegmentTracker tracker, long msb, long lsb, Segment segment) { +public SegmentId(SegmentTracker tracker, long msb, long lsb, Segment segment) { this.tracker = tracker; this.msb = msb; this.lsb = lsb; this.segment = segment; } -SegmentId(SegmentTracker tracker, long msb, long lsb) { +public SegmentId(SegmentTracker tracker, long msb, long lsb) { this(tracker, msb, lsb, null); }
svn commit: r1605799 - /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBDocumentStore.java
Author: reschke Date: Thu Jun 26 14:38:05 2014 New Revision: 1605799 URL: http://svn.apache.org/r1605799 Log: OAK-1914 - add workarounds for VARCHAR limit on Oracle Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBDocumentStore.java Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBDocumentStore.java URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBDocumentStore.java?rev=1605799&r1=1605798&r2=1605799&view=diff == --- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBDocumentStore.java (original) +++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBDocumentStore.java Thu Jun 26 14:38:05 2014 @@ -23,6 +23,7 @@ import java.io.UnsupportedEncodingExcept import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; +import java.sql.ResultSetMetaData; import java.sql.SQLException; import java.sql.Statement; import java.sql.Types; @@ -283,8 +284,9 @@ public class RDBDocumentStore implements private DataSource ds; -// string length at which we switch to BLOB storage -private static int DATALIMIT = 16384 / 4; +// capacity of DATA column +// we assume six octets per Java character as worst case for now +private int datalimit = 16384 / 6; // number of retries for updates private static int RETRIES = 10; @@ -318,9 +320,15 @@ public class RDBDocumentStore implements for (String tableName : new String[] { "CLUSTERNODES", "NODES", "SETTINGS" }) { try { -PreparedStatement stmt = con.prepareStatement("select ID from " + tableName + " where ID = ?"); +PreparedStatement stmt = con.prepareStatement("select DATA from " + tableName + " where ID = ?"); stmt.setString(1, "0:/"); -stmt.executeQuery(); +ResultSet rs = stmt.executeQuery(); + +if ("NODES".equals(tableName)) { +// try to discover size of DATA column +ResultSetMetaData met = rs.getMetaData(); +datalimit = met.getPrecision(1) / 6; +} } catch (SQLException ex) { // table does not appear to exist con.rollback(); @@ -348,7 +356,7 @@ public class RDBDocumentStore implements // see https://issues.apache.org/jira/browse/OAK-1914 stmt.execute("create table " + tableName -+ " (ID varchar(767) not null primary key, MODIFIED number, HASBINARY number, MODCOUNT number, DSIZE number, DATA varchar(4000), BDATA blob)"); ++ " (ID varchar(1000) not null primary key, MODIFIED number, HASBINARY number, MODCOUNT number, DSIZE number, DATA varchar(4000), BDATA blob)"); } else { stmt.execute("create table " + tableName @@ -894,7 +902,7 @@ public class RDBDocumentStore implements stmt.setObject(si++, modcount, Types.BIGINT); stmt.setObject(si++, data.length(), Types.BIGINT); -if (data.length() < DATALIMIT) { +if (data.length() < datalimit) { stmt.setString(si++, data); stmt.setBinaryStream(si++, null, 0); } else { @@ -928,15 +936,14 @@ public class RDBDocumentStore implements stmt.setObject(si++, hasBinary ? 1 : 0, Types.SMALLINT); stmt.setObject(si++, modcount, Types.BIGINT); stmt.setObject(si++, data.length(), Types.BIGINT); -if (data.length() < DATALIMIT) { +if (data.length() < datalimit) { stmt.setString(si++, data); stmt.setBinaryStream(si++, null, 0); } else { -stmt.setString(si++, "truncated...:" + data.substring(0, 1023)); +stmt.setString(si++, "truncated...:" + data.substring(0, datalimit - 20)); byte[] bytes = asBytes(data); stmt.setBytes(si++, bytes); } - int result = stmt.executeUpdate(); if (result != 1) { LOG.debug("DB insert failed for " + tableName + "/" + id);
svn commit: r1605800 - /jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/BasicDocumentStoreTest.java
Author: reschke Date: Thu Jun 26 14:39:30 2014 New Revision: 1605800 URL: http://svn.apache.org/r1605800 Log: OAK-1914 - add tests for various property sizes, checking the cutoff between string and BLOB storage Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/BasicDocumentStoreTest.java Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/BasicDocumentStoreTest.java URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/BasicDocumentStoreTest.java?rev=1605800&r1=1605799&r2=1605800&view=diff == --- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/BasicDocumentStoreTest.java (original) +++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/BasicDocumentStoreTest.java Thu Jun 26 14:39:30 2014 @@ -68,7 +68,7 @@ public class BasicDocumentStoreTest exte while (max - min >= 2) { test = (max + min) / 2; -String id = generateString(test); +String id = generateString(test, true); UpdateOp up = new UpdateOp(id, true); up.set("_id", id); boolean success = super.ds.create(Collection.NODES, Collections.singletonList(up)); @@ -95,7 +95,7 @@ public class BasicDocumentStoreTest exte while (max - min >= 256) { test = (max + min) / 2; String id = this.getClass().getName() + ".testMaxProperty-" + test; -String pval = generateString(test); +String pval = generateString(test, true); UpdateOp up = new UpdateOp(id, true); up.set("_id", id); up.set("foo", pval); @@ -115,6 +115,23 @@ public class BasicDocumentStoreTest exte } @Test +public void testInterestingPropLengths() { +int lengths[] = {1, 10, 100, 1000, 2000, 3000, 4000, 5000, 6000, 7000, 8000, 9000, 1, 11000, 12000, 13000, 14000, 15000, 16000, 2}; + +for (int test : lengths) { +String id = this.getClass().getName() + ".testInterestingPropLengths-" + test; +String pval = generateString(test, false); +UpdateOp up = new UpdateOp(id, true); +up.set("_id", id); +up.set("foo", pval); +super.ds.remove(Collection.NODES, id); +boolean success = super.ds.create(Collection.NODES, Collections.singletonList(up)); +assertTrue("failed to insert a document with property of length " + test, success); +super.ds.remove(Collection.NODES, id); +} +} + +@Test public void testDeleteNonExisting() { String id = this.getClass().getName() + ".testDeleteNonExisting-" + UUID.randomUUID(); // delete is best effort @@ -275,7 +292,7 @@ public class BasicDocumentStoreTest exte } private void createPerf(int size, int amount) { -String pval = generateString(size); +String pval = generateString(size, true); long duration = 1000; long end = System.currentTimeMillis() + duration; long cnt = 0; @@ -312,7 +329,7 @@ public class BasicDocumentStoreTest exte } private void updatePerf(int size) { -String pval = generateString(size); +String pval = generateString(size, true); long duration = 1000; long end = System.currentTimeMillis() + duration; long cnt = 0; @@ -332,11 +349,16 @@ public class BasicDocumentStoreTest exte + (cnt / (duration / 1000f)) + "/s)"); } -private static String generateString(int length) { -StringBuffer buf = new StringBuffer(length); -while (length-- > 0) { -buf.append('A' + ((int) (26 * Math.random(; +private static String generateString(int length, boolean ascii) { +char[] s = new char[length]; +for (int i = 0; i < length; i++) { +if (ascii) { +s[i] = (char)(32 + (int) (95 * Math.random())); +} +else { +s[i] = (char)(32 + (int) ((0xd7ff - 32) * Math.random())); +} } -return buf.toString(); -} +return new String(s); + } }
svn commit: r1605831 - /jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexMBean.java
Author: chetanm Date: Thu Jun 26 16:01:43 2014 New Revision: 1605831 URL: http://svn.apache.org/r1605831 Log: OAK-1893 - MBean to dump Lucene Index content and related stats Removing the operation to dump lucene index as per Angela comments Modified: jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexMBean.java Modified: jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexMBean.java URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexMBean.java?rev=1605831&r1=1605830&r2=1605831&view=diff == --- jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexMBean.java (original) +++ jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexMBean.java Thu Jun 26 16:01:43 2014 @@ -23,26 +23,9 @@ import java.io.IOException; import javax.management.openmbean.TabularData; -import org.apache.jackrabbit.oak.commons.jmx.Description; -import org.apache.jackrabbit.oak.commons.jmx.Name; - public interface LuceneIndexMBean { String TYPE = "LuceneIndex"; TabularData getIndexStats() throws IOException; -/** - * Dumps the lucene index files on to the filesystem - * - * @param sourcePath path in content where the index files are stores - * @param destPath path on server where the index content needs to be copied - * @throws IOException - */ -void dumpIndexContent(@Name("sourcePath") - @Description("Index path in content. Can be null") - String sourcePath, - - @Name("destPath") - @Description("Target directory path on server where the index content needs to be copied") - String destPath) throws IOException; }
svn commit: r1605852 - /jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexMBeanImpl.java
Author: chetanm Date: Thu Jun 26 16:46:54 2014 New Revision: 1605852 URL: http://svn.apache.org/r1605852 Log: OAK-1893 - MBean to dump Lucene Index content and related stats Remove the override Modified: jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexMBeanImpl.java Modified: jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexMBeanImpl.java URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexMBeanImpl.java?rev=1605852&r1=1605851&r2=1605852&view=diff == --- jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexMBeanImpl.java (original) +++ jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexMBeanImpl.java Thu Jun 26 16:46:54 2014 @@ -81,7 +81,6 @@ public class LuceneIndexMBeanImpl extend return tds; } -@Override public void dumpIndexContent(String sourcePath, String destPath) throws IOException { IndexNode indexNode = null; try {
svn commit: r1605968 - /jackrabbit/oak/trunk/oak-auth-external/src/test/java/org/apache/jackrabbit/oak/spi/security/authentication/external/ExternalLoginModuleTest.java
Author: angela Date: Fri Jun 27 06:50:48 2014 New Revision: 1605968 URL: http://svn.apache.org/r1605968 Log: unused import Modified: jackrabbit/oak/trunk/oak-auth-external/src/test/java/org/apache/jackrabbit/oak/spi/security/authentication/external/ExternalLoginModuleTest.java Modified: jackrabbit/oak/trunk/oak-auth-external/src/test/java/org/apache/jackrabbit/oak/spi/security/authentication/external/ExternalLoginModuleTest.java URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-auth-external/src/test/java/org/apache/jackrabbit/oak/spi/security/authentication/external/ExternalLoginModuleTest.java?rev=1605968&r1=1605967&r2=1605968&view=diff == --- jackrabbit/oak/trunk/oak-auth-external/src/test/java/org/apache/jackrabbit/oak/spi/security/authentication/external/ExternalLoginModuleTest.java (original) +++ jackrabbit/oak/trunk/oak-auth-external/src/test/java/org/apache/jackrabbit/oak/spi/security/authentication/external/ExternalLoginModuleTest.java Fri Jun 27 06:50:48 2014 @@ -19,7 +19,6 @@ package org.apache.jackrabbit.oak.spi.se import java.util.HashMap; import javax.jcr.SimpleCredentials; -import javax.jcr.Value; import javax.security.auth.login.LoginException; import org.apache.jackrabbit.api.security.user.Authorizable; @@ -29,7 +28,6 @@ import org.apache.jackrabbit.oak.namepat import org.apache.jackrabbit.oak.plugins.value.ValueFactoryImpl; import org.junit.After; import org.junit.Before; -import org.junit.Ignore; import org.junit.Test; import static org.junit.Assert.assertEquals;
svn commit: r1605969 - in /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak: security/user/MembershipProvider.java spi/security/authorization/accesscontrol/AbstractAccessControlMa
Author: angela Date: Fri Jun 27 06:51:37 2014 New Revision: 1605969 URL: http://svn.apache.org/r1605969 Log: fix indention Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/MembershipProvider.java jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/authorization/accesscontrol/AbstractAccessControlManager.java Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/MembershipProvider.java URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/MembershipProvider.java?rev=1605969&r1=1605968&r2=1605969&view=diff == --- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/MembershipProvider.java (original) +++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/MembershipProvider.java Fri Jun 27 06:51:37 2014 @@ -232,7 +232,7 @@ class MembershipProvider extends Authori */ @Nonnull private Iterator getMembers(@Nonnull final Tree groupTree, @Nonnull final AuthorizableType authorizableType, -final boolean includeInherited, @Nonnull final Set processedRefs) { +final boolean includeInherited, @Nonnull final Set processedRefs) { return new AbstractLazyIterator() { Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/authorization/accesscontrol/AbstractAccessControlManager.java URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/authorization/accesscontrol/AbstractAccessControlManager.java?rev=1605969&r1=1605968&r2=1605969&view=diff == --- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/authorization/accesscontrol/AbstractAccessControlManager.java (original) +++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/authorization/accesscontrol/AbstractAccessControlManager.java Fri Jun 27 06:51:37 2014 @@ -203,8 +203,8 @@ public abstract class AbstractAccessCont @Nonnull private Privilege[] getPrivileges(@Nullable String absPath, -@Nonnull PermissionProvider provider, -long permissions) throws RepositoryException { + @Nonnull PermissionProvider provider, + long permissions) throws RepositoryException { Tree tree; if (absPath == null) { tree = null;