Skip to content
Browse files

Fixing code indentation

  • Loading branch information...
1 parent c1d8ff5 commit 9f5b01c2cc18c3b81523d672c288174841d16549 @sagarl sagarl committed Feb 11, 2014
View
73 ...ax-entity-mapper/src/main/java/com/netflix/astyanax/entitystore/DefaultEntityManager.java
@@ -49,7 +49,7 @@
private LifecycleEvents<T> lifecycleHandler = null;
private String columnFamilyName = null;
private boolean autoCommit = true;
- private Partitioner partitioner = DEFAULT_ENTITY_MANAGER_PARTITIONER;
+ private Partitioner partitioner = DEFAULT_ENTITY_MANAGER_PARTITIONER;
public Builder() {
@@ -150,40 +150,42 @@ public Builder() {
}
public Builder<T, K> withAutoCommit(boolean autoCommit) {
- this.autoCommit = autoCommit;
- return this;
+ this.autoCommit = autoCommit;
+ return this;
}
- /**
- * Partitioner used to determine token ranges and how to break token ranges
- * into sub parts. The default is BigInteger127Partitioner in pre-cassandra 1.2.
- *
- * @param partitioner
- * @return
- */
- public Builder<T, K> withPartitioner(Partitioner partitioner) {
- this.partitioner = partitioner;
- return this;
- }
+ /**
+ * Partitioner used to determine token ranges and how to break token
+ * ranges into sub parts. The default is BigInteger127Partitioner in
+ * pre-cassandra 1.2.
+ *
+ * @param partitioner
+ * @return
+ */
+ public Builder<T, K> withPartitioner(Partitioner partitioner) {
+ this.partitioner = partitioner;
+ return this;
+ }
@SuppressWarnings("unchecked")
- public DefaultEntityManager<T, K> build() {
- // check mandatory fields
+ public DefaultEntityManager<T, K> build() {
+ // check mandatory fields
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: 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);
if (columnFamily == null) {
- if (columnFamilyName == null)
- columnFamilyName = entityMapper.getEntityName();
- columnFamily = new ColumnFamily<K, String>(
- columnFamilyName,
- (com.netflix.astyanax.Serializer<K>)MappingUtils.getSerializerForField(this.entityMapper.getId()),
- StringSerializer.get());
+ if (columnFamilyName == null)
+ columnFamilyName = entityMapper.getEntityName();
+ columnFamily = new ColumnFamily<K, String>(columnFamilyName,
+ (com.netflix.astyanax.Serializer<K>) MappingUtils
+ .getSerializerForField(this.entityMapper
+ .getId()), StringSerializer.get());
}
// build object
return new DefaultEntityManager<T, K>(this);
@@ -197,17 +199,18 @@ public Builder() {
//////////////////////////////////////////////////////////////////
// private members
- private final EntityMapper<T,K> entityMapper;
- private final Keyspace keyspace;
- private final ColumnFamily<K, String> columnFamily;
- private final ConsistencyLevel readConsitency;
- private final ConsistencyLevel writeConsistency;
- private final RetryPolicy retryPolicy;
- private final LifecycleEvents<T> lifecycleHandler;
- private final boolean autoCommit;
+ private final EntityMapper<T, K> entityMapper;
+ private final Keyspace keyspace;
+ private final ColumnFamily<K, String> columnFamily;
+ private final ConsistencyLevel readConsitency;
+ private final ConsistencyLevel writeConsistency;
+ private final RetryPolicy retryPolicy;
+ private final LifecycleEvents<T> lifecycleHandler;
+ private final boolean autoCommit;
private final ThreadLocal<MutationBatch> tlMutation = new ThreadLocal<MutationBatch>();
- private static final Partitioner DEFAULT_ENTITY_MANAGER_PARTITIONER = BigInteger127Partitioner.get();
- private final Partitioner partitioner;
+ private static final Partitioner DEFAULT_ENTITY_MANAGER_PARTITIONER = BigInteger127Partitioner
+ .get();
+ private final Partitioner partitioner;
private DefaultEntityManager(Builder<T, K> builder) {
entityMapper = builder.entityMapper;

0 comments on commit 9f5b01c

Please sign in to comment.
Something went wrong with that request. Please try again.