You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by gr...@apache.org on 2015/03/18 21:56:41 UTC
[41/50] incubator-usergrid git commit: Merge remote-tracking branch
'origin/USERGRID-466-change-write-consistency' into USERGRID-466
Merge remote-tracking branch 'origin/USERGRID-466-change-write-consistency' into USERGRID-466
Conflicts:
stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexImpl.java
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/205e0e0c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/205e0e0c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/205e0e0c
Branch: refs/heads/USERGRID-460
Commit: 205e0e0c03c176623fe9fa2cc18e6a32878838b5
Parents: 2d6ae36 45271d7
Author: Todd Nine <tn...@apigee.com>
Authored: Sun Mar 15 13:56:33 2015 -0600
Committer: Todd Nine <tn...@apigee.com>
Committed: Sun Mar 15 13:56:33 2015 -0600
----------------------------------------------------------------------
.../collection/EntityDeletedFactory.java | 34 -----
.../collection/EntityVersionCleanupFactory.java | 35 -----
.../collection/EntityVersionCreatedFactory.java | 31 -----
.../impl/EntityVersionTaskFactory.java | 65 ++++++++++
.../mvcc/stage/write/WriteUniqueVerify.java | 130 ++++++++++++-------
.../UniqueValueSerializationStrategy.java | 21 ++-
.../UniqueValueSerializationStrategyImpl.java | 19 ++-
.../mvcc/stage/write/WriteUniqueVerifyTest.java | 6 +-
.../core/astyanax/CassandraConfig.java | 6 +
.../core/astyanax/CassandraConfigImpl.java | 8 +-
.../persistence/core/astyanax/CassandraFig.java | 9 +-
.../core/astyanax/ColumnNameIteratorTest.java | 7 +-
.../MultiKeyColumnNameIteratorTest.java | 7 +-
.../astyanax/MultiRowColumnIteratorTest.java | 7 +-
.../index/impl/EsEntityIndexImpl.java | 31 +++--
15 files changed, 238 insertions(+), 178 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/205e0e0c/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/EntityDeletedFactory.java
----------------------------------------------------------------------
diff --cc stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/EntityDeletedFactory.java
index 3c673ee,3c673ee..0000000
deleted file mode 100644,100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/EntityDeletedFactory.java
+++ /dev/null
@@@ -1,34 -1,34 +1,0 @@@
--/*
-- *
-- * * Licensed to the Apache Software Foundation (ASF) under one or more
-- * * contributor license agreements. 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. For additional information regarding
-- * * copyright in this work, please see the NOTICE file in the top level
-- * * directory of this distribution.
-- *
-- */
--
--package org.apache.usergrid.persistence.collection;
--
--import org.apache.usergrid.persistence.collection.impl.EntityDeletedTask;
--import org.apache.usergrid.persistence.model.entity.Id;
--
--import java.util.UUID;
--
--/**
-- * Creates EntityDeletedTask instances
-- */
--public interface EntityDeletedFactory {
-- public EntityDeletedTask getTask(final CollectionScope collectionScope, final Id entityId, final UUID version );
--
--}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/205e0e0c/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/EntityVersionCleanupFactory.java
----------------------------------------------------------------------
diff --cc stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/EntityVersionCleanupFactory.java
index 2232f00,2232f00..0000000
deleted file mode 100644,100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/EntityVersionCleanupFactory.java
+++ /dev/null
@@@ -1,35 -1,35 +1,0 @@@
--/*
-- * Licensed to the Apache Software Foundation (ASF) under one or more
-- * contributor license agreements. 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. For additional information regarding
-- * copyright in this work, please see the NOTICE file in the top level
-- * directory of this distribution.
-- */
--package org.apache.usergrid.persistence.collection;
--
--
--
--import org.apache.usergrid.persistence.collection.impl.EntityVersionCleanupTask;
--import org.apache.usergrid.persistence.model.entity.Id;
--
--import java.util.UUID;
--
--
--public interface EntityVersionCleanupFactory {
--
-- public EntityVersionCleanupTask getTask(
-- final CollectionScope scope,
-- final Id entityId,
-- final UUID version );
--
--}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/205e0e0c/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/EntityVersionCreatedFactory.java
----------------------------------------------------------------------
diff --cc stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/EntityVersionCreatedFactory.java
index 4248d42,4248d42..0000000
deleted file mode 100644,100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/EntityVersionCreatedFactory.java
+++ /dev/null
@@@ -1,31 -1,31 +1,0 @@@
--/*
-- * 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.usergrid.persistence.collection;
--
--
--import java.util.UUID;
--
--import org.apache.usergrid.persistence.collection.impl.EntityVersionCreatedTask;
--import org.apache.usergrid.persistence.model.entity.Entity;
--import org.apache.usergrid.persistence.model.entity.Id;
--
--public interface EntityVersionCreatedFactory {
-- public EntityVersionCreatedTask getTask( final CollectionScope scope, final Entity entity);
--
--}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/205e0e0c/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/impl/EntityVersionTaskFactory.java
----------------------------------------------------------------------
diff --cc stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/impl/EntityVersionTaskFactory.java
index 0000000,0000000..b41e668
new file mode 100644
--- /dev/null
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/impl/EntityVersionTaskFactory.java
@@@ -1,0 -1,0 +1,65 @@@
++/*
++ * Licensed to the Apache Software Foundation (ASF) under one or more
++ * contributor license agreements. 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. For additional information regarding
++ * copyright in this work, please see the NOTICE file in the top level
++ * directory of this distribution.
++ */
++package org.apache.usergrid.persistence.collection.impl;
++
++
++
++import org.apache.usergrid.persistence.collection.CollectionScope;
++import org.apache.usergrid.persistence.collection.impl.EntityDeletedTask;
++import org.apache.usergrid.persistence.collection.impl.EntityVersionCleanupTask;
++import org.apache.usergrid.persistence.collection.impl.EntityVersionCreatedTask;
++import org.apache.usergrid.persistence.model.entity.Entity;
++import org.apache.usergrid.persistence.model.entity.Id;
++
++import java.util.UUID;
++
++
++public interface EntityVersionTaskFactory {
++
++ /**
++ * Get a task for cleaning up latent entity data. If includeVersion = true, the passed version will be cleaned up as well
++ * Otherwise this is a V-1 operation
++ *
++ * @param scope
++ * @param entityId
++ * @param version
++ * @param includeVersion
++ * @return
++ */
++ public EntityVersionCleanupTask getCleanupTask( final CollectionScope scope, final Id entityId, final UUID version,
++ final boolean includeVersion );
++
++ /**
++ * Get an entityVersionCreatedTask
++ * @param scope
++ * @param entity
++ * @return
++ */
++ public EntityVersionCreatedTask getCreatedTask( final CollectionScope scope, final Entity entity );
++
++ /**
++ * Get an entity deleted task
++ * @param collectionScope
++ * @param entityId
++ * @param version
++ * @return
++ */
++ public EntityDeletedTask getDeleteTask( final CollectionScope collectionScope, final Id entityId,
++ final UUID version );
++
++}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/205e0e0c/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexImpl.java
----------------------------------------------------------------------
diff --cc stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexImpl.java
index 8be044f,9343d39..3a11ec7
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexImpl.java
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexImpl.java
@@@ -169,26 -173,36 +172,36 @@@ public class EsEntityIndexImpl implemen
this.alias = indexIdentifier.getAlias();
this.failureMonitor = new FailureMonitorImpl( config, provider );
this.aliasCache = indexCache;
- this.metricsFactory = metricsFactory;
this.addTimer = metricsFactory
- .getTimer( EsEntityIndexImpl.class, "es.entity.index.add.index.timer" );
+ .getTimer( EsEntityIndexImpl.class, "add.timer" );
this.removeAliasTimer = metricsFactory
- .getTimer( EsEntityIndexImpl.class, "es.entity.index.remove.index.alias.timer" );
+ .getTimer( EsEntityIndexImpl.class, "remove.alias.timer" );
this.addReadAliasTimer = metricsFactory
- .getTimer( EsEntityIndexImpl.class, "es.entity.index.add.read.alias.timer" );
+ .getTimer( EsEntityIndexImpl.class, "add.read.alias.timer" );
this.addWriteAliasTimer = metricsFactory
- .getTimer( EsEntityIndexImpl.class, "es.entity.index.add.write.alias.timer" );
+ .getTimer( EsEntityIndexImpl.class, "add.write.alias.timer" );
this.mappingTimer = metricsFactory
- .getTimer( EsEntityIndexImpl.class, "es.entity.index.create.mapping.timer" );
+ .getTimer( EsEntityIndexImpl.class, "create.mapping.timer" );
this.refreshTimer = metricsFactory
- .getTimer( EsEntityIndexImpl.class, "es.entity.index.refresh.timer" );
+ .getTimer( EsEntityIndexImpl.class, "refresh.timer" );
this.searchTimer =metricsFactory
- .getTimer( EsEntityIndexImpl.class, "es.entity.index.search.timer" );
+ .getTimer( EsEntityIndexImpl.class, "search.timer" );
this.cursorTimer = metricsFactory
- .getTimer( EsEntityIndexImpl.class, "es.entity.index.search.cursor.timer" );
+ .getTimer( EsEntityIndexImpl.class, "search.cursor.timer" );
this.getVersionsTimer =metricsFactory
- .getTimer( EsEntityIndexImpl.class, "es.entity.index.get.versions.timer" );
+ .getTimer( EsEntityIndexImpl.class, "get.versions.timer" );
+ this.allVersionsTimer = metricsFactory
+ .getTimer( EsEntityIndexImpl.class, "delete.all.versions.timer" );
+ this.deletePreviousTimer = metricsFactory
+ .getTimer( EsEntityIndexImpl.class, "delete.previous.versions.timer" );
+ this.allVersionsTimerFuture = metricsFactory
+ .getTimer( EsEntityIndexImpl.class, "delete.all.versions.timer.future" );
+ this.deletePreviousTimerFuture = metricsFactory
+ .getTimer( EsEntityIndexImpl.class, "delete.previous.versions.timer.future" );
+
+ this.errorMeter = metricsFactory.getMeter(EsEntityIndexImpl.class,"errors");
+
final MapScope mapScope = new MapScopeImpl( appScope.getApplication(), "cursorcache" );
mapManager = mapManagerFactory.createMapManager(mapScope);