Skip to content

Commit

Permalink
Fixing code indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
sagarl committed Feb 12, 2014
1 parent c1d8ff5 commit 9f5b01c
Showing 1 changed file with 38 additions and 35 deletions.
Expand Up @@ -49,7 +49,7 @@ public static class Builder<T, K> {
private LifecycleEvents<T> lifecycleHandler = null; private LifecycleEvents<T> lifecycleHandler = null;
private String columnFamilyName = null; private String columnFamilyName = null;
private boolean autoCommit = true; private boolean autoCommit = true;
private Partitioner partitioner = DEFAULT_ENTITY_MANAGER_PARTITIONER; private Partitioner partitioner = DEFAULT_ENTITY_MANAGER_PARTITIONER;


public Builder() { public Builder() {


Expand Down Expand Up @@ -150,40 +150,42 @@ public Builder<T, K> withRetryPolicy(RetryPolicy policy) {
} }


public Builder<T, K> withAutoCommit(boolean autoCommit) { public Builder<T, K> withAutoCommit(boolean autoCommit) {
this.autoCommit = autoCommit; this.autoCommit = autoCommit;
return this; return this;
} }


/** /**
* Partitioner used to determine token ranges and how to break token ranges * Partitioner used to determine token ranges and how to break token
* into sub parts. The default is BigInteger127Partitioner in pre-cassandra 1.2. * ranges into sub parts. The default is BigInteger127Partitioner in
* * pre-cassandra 1.2.
* @param partitioner *
* @return * @param partitioner
*/ * @return
public Builder<T, K> withPartitioner(Partitioner partitioner) { */
this.partitioner = partitioner; public Builder<T, K> withPartitioner(Partitioner partitioner) {
return this; this.partitioner = partitioner;
} return this;
}


@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public DefaultEntityManager<T, K> build() { public DefaultEntityManager<T, K> build() {
// check mandatory fields // check mandatory fields
Preconditions.checkNotNull(clazz, "withEntityType(...) is not set"); Preconditions.checkNotNull(clazz, "withEntityType(...) is not set");
Preconditions.checkNotNull(keyspace, "withKeyspace(...) is not set"); Preconditions

.checkNotNull(keyspace, "withKeyspace(...) is not set");

// TODO: check @Id type compatibility // TODO: check @Id type compatibility
// TODO: do we need to require @Entity annotation // TODO: do we need to require @Entity annotation
this.entityMapper = new EntityMapper<T,K>(clazz, ttl); this.entityMapper = new EntityMapper<T, K>(clazz, ttl);
this.lifecycleHandler = new LifecycleEvents<T>(clazz); this.lifecycleHandler = new LifecycleEvents<T>(clazz);


if (columnFamily == null) { if (columnFamily == null) {
if (columnFamilyName == null) if (columnFamilyName == null)
columnFamilyName = entityMapper.getEntityName(); columnFamilyName = entityMapper.getEntityName();
columnFamily = new ColumnFamily<K, String>( columnFamily = new ColumnFamily<K, String>(columnFamilyName,
columnFamilyName, (com.netflix.astyanax.Serializer<K>) MappingUtils
(com.netflix.astyanax.Serializer<K>)MappingUtils.getSerializerForField(this.entityMapper.getId()), .getSerializerForField(this.entityMapper
StringSerializer.get()); .getId()), StringSerializer.get());
} }
// build object // build object
return new DefaultEntityManager<T, K>(this); return new DefaultEntityManager<T, K>(this);
Expand All @@ -197,17 +199,18 @@ public static <T,K> Builder<T,K> builder() {
////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////
// private members // private members


private final EntityMapper<T,K> entityMapper; private final EntityMapper<T, K> entityMapper;
private final Keyspace keyspace; private final Keyspace keyspace;
private final ColumnFamily<K, String> columnFamily; private final ColumnFamily<K, String> columnFamily;
private final ConsistencyLevel readConsitency; private final ConsistencyLevel readConsitency;
private final ConsistencyLevel writeConsistency; private final ConsistencyLevel writeConsistency;
private final RetryPolicy retryPolicy; private final RetryPolicy retryPolicy;
private final LifecycleEvents<T> lifecycleHandler; private final LifecycleEvents<T> lifecycleHandler;
private final boolean autoCommit; private final boolean autoCommit;
private final ThreadLocal<MutationBatch> tlMutation = new ThreadLocal<MutationBatch>(); private final ThreadLocal<MutationBatch> tlMutation = new ThreadLocal<MutationBatch>();
private static final Partitioner DEFAULT_ENTITY_MANAGER_PARTITIONER = BigInteger127Partitioner.get(); private static final Partitioner DEFAULT_ENTITY_MANAGER_PARTITIONER = BigInteger127Partitioner
private final Partitioner partitioner; .get();
private final Partitioner partitioner;


private DefaultEntityManager(Builder<T, K> builder) { private DefaultEntityManager(Builder<T, K> builder) {
entityMapper = builder.entityMapper; entityMapper = builder.entityMapper;
Expand Down

0 comments on commit 9f5b01c

Please sign in to comment.