You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by sf...@apache.org on 2014/10/09 22:01:45 UTC
[3/4] git commit: merged
merged
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/a61e146c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/a61e146c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/a61e146c
Branch: refs/heads/collection_multiget
Commit: a61e146c4de34398c3d74cca0ca4ec42bc73fe23
Parents: 0d508f9 b3515f4
Author: Shawn Feldman <sf...@apache.org>
Authored: Thu Oct 9 14:00:22 2014 -0600
Committer: Shawn Feldman <sf...@apache.org>
Committed: Thu Oct 9 14:00:22 2014 -0600
----------------------------------------------------------------------
.../impl/EntityCollectionManagerImpl.java | 48 ++++++++++++++++----
1 file changed, 40 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/a61e146c/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/impl/EntityCollectionManagerImpl.java
----------------------------------------------------------------------
diff --cc stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/impl/EntityCollectionManagerImpl.java
index fab4269,32f214f..a1b9a13
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/impl/EntityCollectionManagerImpl.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/impl/EntityCollectionManagerImpl.java
@@@ -218,44 -209,39 +219,54 @@@ public class EntityCollectionManagerImp
@Override
- public Observable<EntitySet> load( final Collection<Id> entityIds ) {
+ public Observable<EntitySet> load(final Collection<Id> entityIds) {
+
+ Preconditions.checkNotNull(entityIds, "entityIds cannot be null");
- final EntitySet results =
- entitySerializationStrategy.load(collectionScope, entityIds, UUIDGenerator.newTimeUUID());
- Preconditions.checkNotNull( entityIds, "entityIds cannot be null" );
- return Observable.just(results);
- return Observable.create( new Observable.OnSubscribe<EntitySet>() {
++ return Observable.create(new Observable.OnSubscribe<EntitySet>() {
+
+ @Override
- public void call( final Subscriber<? super EntitySet> subscriber ) {
++ public void call(final Subscriber<? super EntitySet> subscriber) {
+ try {
+ final EntitySet results =
- entitySerializationStrategy.load( collectionScope, entityIds, UUIDGenerator.newTimeUUID() );
++ entitySerializationStrategy.load(collectionScope, entityIds, UUIDGenerator.newTimeUUID());
+
- subscriber.onNext( results );
++ subscriber.onNext(results);
+ subscriber.onCompleted();
- }
- catch ( Exception e ) {
- subscriber.onError( e );
++ } catch (Exception e) {
++ subscriber.onError(e);
+ }
+ }
- } );
-
-
-
++ });
}
+ @Override
+ public Observable<Id> getIdField(final Field field) {
+ final List<Field> fields = Collections.singletonList(field);
- rx.Observable<Id> o = rx.Observable.from(fields).map(new Func1<Field, Id>() {
++ return rx.Observable.from(fields).map(new Func1<Field, Id>() {
+ @Override
+ public Id call(Field field) {
+ try {
+ UniqueValueSet set = uniqueValueSerializationStrategy.load(collectionScope, fields);
+ UniqueValue value = set.getValue(field.getName());
- Id id = value == null ? null :value.getEntityId();
++ Id id = value == null ? null : value.getEntityId();
+ return id;
+ } catch (ConnectionException e) {
+ log.error("Failed to getIdField", e);
+ throw new RuntimeException(e);
+ }
+ }
+ });
- return o;
+ }
-
@Override
- public Observable<Entity> update( final Entity entity ) {
+ public Observable<Entity> update(final Entity entity) {
- log.debug( "Starting update process" );
+ log.debug("Starting update process");
//do our input validation
- Preconditions.checkNotNull( entity, "Entity is required in the new stage of the mvcc write" );
+ Preconditions.checkNotNull(entity, "Entity is required in the new stage of the mvcc write");
final Id entityId = entity.getId();
@@@ -314,13 -300,26 +325,34 @@@
@Override
++<<<<<<< HEAD
+ public Observable<VersionSet> getLatestVersion(
+ Collection<Id> entityIds) {
+
+ VersionSet logEntries = mvccLogEntrySerializationStrategy.load(collectionScope, entityIds,
+ UUIDGenerator.newTimeUUID());
++=======
+ public Observable<VersionSet> getLatestVersion( final Collection<Id> entityIds ) {
+
+ return Observable.create( new Observable.OnSubscribe<VersionSet>() {
+
+ @Override
+ public void call( final Subscriber<? super VersionSet> subscriber ) {
+ try {
+ final VersionSet logEntries = mvccLogEntrySerializationStrategy.load( collectionScope, entityIds,
+ UUIDGenerator.newTimeUUID() );
+
+ subscriber.onNext( logEntries );
+ subscriber.onCompleted();
+ }
+ catch ( Exception e ) {
+ subscriber.onError( e );
+ }
+ }
+ } );
+
++>>>>>>> b3515f45cdfdcc0eedd6e667701f69eccad37a7d
- return Observable.just(logEntries);
}
}