usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From toddn...@apache.org
Subject [3/5] git commit: Merge branch 'two-dot-o' into key-row-sharding
Date Sat, 01 Nov 2014 20:23:39 GMT
Merge branch 'two-dot-o' into key-row-sharding

Conflicts:
	stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexImpl.java
	stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsProvider.java
	stack/rest/src/main/java/org/apache/usergrid/rest/filters/HealthCheckFilter.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/fb03144a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/fb03144a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/fb03144a

Branch: refs/heads/key-row-sharding
Commit: fb03144a6970b35db0d9e54ca0a3f12f64424cd2
Parents: 400189e 63fb7df
Author: Todd Nine <tnine@apigee.com>
Authored: Sat Nov 1 12:54:24 2014 -0600
Committer: Todd Nine <tnine@apigee.com>
Committed: Sat Nov 1 12:54:24 2014 -0600

----------------------------------------------------------------------
 .../dist/init_instance/init_opscenter_server.sh |  75 +++++++++++
 .../src/main/groovy/configure_opscenter.groovy  | 129 +++++++++++++++++++
 .../index/impl/EsEntityIndexImpl.java           |   4 +-
 3 files changed, 206 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/fb03144a/stack/awscluster/src/main/dist/init_instance/init_opscenter_server.sh
----------------------------------------------------------------------
diff --cc stack/awscluster/src/main/dist/init_instance/init_opscenter_server.sh
index 0000000,0000000..42a7ebf
new file mode 100644
--- /dev/null
+++ b/stack/awscluster/src/main/dist/init_instance/init_opscenter_server.sh
@@@ -1,0 -1,0 +1,75 @@@
++#!/bin/bash
++
++# 
++#  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.
++#
++
++
++
++
++echo "${HOSTNAME}" > /etc/hostname
++echo "127.0.0.1 ${HOSTNAME}" >> /etc/hosts
++hostname `cat /etc/hostname`
++
++echo "US/Eastern" > /etc/timezone
++dpkg-reconfigure -f noninteractive tzdata
++
++# Build environment for scripts
++. /etc/profile.d/aws-credentials.sh
++. /etc/profile.d/usergrid-env.sh
++
++cd /usr/share/usergrid/init_instance
++./create_raid0.sh
++
++# Install the easy stuff
++PKGS="ntp unzip groovy curl"
++apt-get update
++apt-get -y --force-yes install ${PKGS}
++/etc/init.d/tomcat7 stop
++
++# Install AWS Java SDK and get it into the Groovy classpath
++curl http://sdk-for-java.amazonwebservices.com/latest/aws-java-sdk.zip > /tmp/aws-sdk-java.zip
++cd /usr/share/
++unzip /tmp/aws-sdk-java.zip 
++mkdir -p /home/ubuntu/.groovy/lib
++cp /usr/share/aws-java-sdk-*/third-party/*/*.jar /home/ubuntu/.groovy/lib
++cp /usr/share/aws-java-sdk-*/lib/* /home/ubuntu/.groovy/lib 
++# except for evil stax
++rm /home/ubuntu/.groovy/lib/stax*
++ln -s /home/ubuntu/.groovy /root/.groovy
++
++# tag last so we can see in the console so that we know what's running
++cd /usr/share/usergrid/scripts
++groovy tag_instance.groovy -BUILD-IN-PROGRESS
++
++cd /usr/share/usergrid/init_instance
++./install_oraclejdk.sh 
++
++# Install and stop Cassandra 
++cd /usr/share/usergrid/init_instance
++./install_cassandra.sh
++
++cd /usr/share/usergrid/init_instance
++./install_opscenter_agent.sh
++
++# Use the CQL to crate the keyspaces
++cd /usr/share/usergrid/init_instance
++./create_keyspaces.sh
++
++# tag last so we can see in the console that the script ran to completion
++cd /usr/share/usergrid/scripts
++groovy tag_instance.groovy

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/fb03144a/stack/awscluster/src/main/groovy/configure_opscenter.groovy
----------------------------------------------------------------------
diff --cc stack/awscluster/src/main/groovy/configure_opscenter.groovy
index 0000000,0000000..946e801
new file mode 100644
--- /dev/null
+++ b/stack/awscluster/src/main/groovy/configure_opscenter.groovy
@@@ -1,0 -1,0 +1,129 @@@
++/*
++ * 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.
++ */
++
++
++// configure_cassandra.groovy 
++// 
++// Emits Cassandra config file based on environment and Cassandra node 
++// registry in SimpleDB
++//
++import com.amazonaws.auth.*
++import com.amazonaws.services.simpledb.*
++import com.amazonaws.services.simpledb.model.*
++
++
++String hostName  = (String)System.getenv().get("PUBLIC_HOSTNAME")
++String clusterName  = (String)System.getenv().get("CASSANDRA_CLUSTER_NAME")
++
++
++// build seed list by listing all Cassandra nodes found in SimpleDB domain with our stackName
++
++NodeRegistry registry = new NodeRegistry();
++
++def selectResult = registry.searchNode('cassandra')
++def seeds = ""
++def sep = ""
++for (host in selectResult) {
++    seeds = "${seeds}${sep}${host}"
++    sep = ","
++}
++
++
++def cassandraConfig = """
++
++
++cluster_name: '${clusterName}'
++listen_address: ${hostName}
++seed_provider:
++    - class_name: org.apache.cassandra.locator.SimpleSeedProvider
++      parameters:
++          - seeds: "${seeds}"
++auto_bootstrap: false 
++num_tokens: 256
++hinted_handoff_enabled: true
++hinted_handoff_throttle_in_kb: 1024
++max_hints_delivery_threads: 2
++authenticator: org.apache.cassandra.auth.AllowAllAuthenticator
++authorizer: org.apache.cassandra.auth.AllowAllAuthorizer
++partitioner: org.apache.cassandra.dht.Murmur3Partitioner
++data_file_directories:
++    - /mnt/data/cassandra/data
++commitlog_directory: /mnt/data/cassandra/commitlog
++disk_failure_policy: stop
++key_cache_size_in_mb: 2048
++key_cache_save_period: 14400
++row_cache_size_in_mb: 2048
++row_cache_save_period: 14400
++row_cache_provider: SerializingCacheProvider
++saved_caches_directory: /mnt/data/cassandra/saved_caches
++commitlog_sync: periodic
++commitlog_sync_period_in_ms: 10000
++commitlog_segment_size_in_mb: 32
++flush_largest_memtables_at: 0.75
++reduce_cache_sizes_at: 0.85
++reduce_cache_capacity_to: 0.6
++concurrent_reads: 32
++concurrent_writes: 32
++memtable_flush_queue_size: 4
++trickle_fsync: false
++trickle_fsync_interval_in_kb: 10240
++storage_port: 7000
++ssl_storage_port: 7001
++rpc_address: 0.0.0.0
++start_native_transport: false
++native_transport_port: 9042
++start_rpc: true
++rpc_port: 9160
++rpc_keepalive: true
++rpc_server_type: sync
++thrift_framed_transport_size_in_mb: 15
++thrift_max_message_length_in_mb: 16
++incremental_backups: false
++snapshot_before_compaction: false
++auto_snapshot: true
++column_index_size_in_kb: 64
++in_memory_compaction_limit_in_mb: 64
++multithreaded_compaction: false
++compaction_throughput_mb_per_sec: 16
++compaction_preheat_key_cache: true
++read_request_timeout_in_ms: 10000
++range_request_timeout_in_ms: 10000
++write_request_timeout_in_ms: 10000
++truncate_request_timeout_in_ms: 60000
++request_timeout_in_ms: 10000
++cross_node_timeout: false
++endpoint_snitch: Ec2Snitch
++dynamic_snitch_update_interval_in_ms: 100
++dynamic_snitch_reset_interval_in_ms: 600000
++dynamic_snitch_badness_threshold: 0.1
++request_scheduler: org.apache.cassandra.scheduler.NoScheduler
++index_interval: 128
++server_encryption_options:
++    internode_encryption: none
++    keystore: conf/.keystore
++    keystore_password: cassandra
++    truststore: conf/.truststore
++    truststore_password: cassandra
++client_encryption_options:
++    enabled: false
++    keystore: conf/.keystore
++    keystore_password: cassandra
++internode_compression: all
++"""
++
++println cassandraConfig

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/fb03144a/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 c2334eb,23accdd..ee33c7b
--- 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
@@@ -183,19 -174,17 +183,19 @@@ public class EsEntityIndexImpl implemen
              public boolean doOp() {
                  final String tempId = UUIDGenerator.newTimeUUID().toString();
  
 -                client.prepareIndex( indexName, VERIFY_TYPE, tempId )
 -                        .setSource( DEFAULT_PAYLOAD ).get();
 +                esProvider.getClient().prepareIndex( indexName, VERIFY_TYPE, tempId ).setSource(
DEFAULT_PAYLOAD ).get();
  
 -                logger.info( "Successfully created new document with docId {} in index {}
and type {}", 
 +                logger.info( "Successfully created new document with docId {} in index {}
and type {}", tempId, indexName,
 +                        VERIFY_TYPE );
-                 logger.info( "Successfully created new document with docId {} in index {}
and type {}", 
++                logger.info( "Successfully created new document with docId {} in index {}
and type {}",
                          tempId, indexName, VERIFY_TYPE );
  
                  // delete all types, this way if we miss one it will get cleaned up
 -                client.prepareDeleteByQuery( indexName ).setTypes( VERIFY_TYPE )
 -                        .setQuery( MATCH_ALL_QUERY_BUILDER ).get();
 +                esProvider.getClient().prepareDeleteByQuery( indexName ).setTypes( VERIFY_TYPE
).setQuery( MATCH_ALL_QUERY_BUILDER )
 +                      .get();
  
 -                logger.info( "Successfully deleted all documents in index {} and type {}",

 +                logger.info( "Successfully deleted all documents in index {} and type {}",
indexName, VERIFY_TYPE );
-                 logger.info( "Successfully deleted all documents in index {} and type {}",

++                logger.info( "Successfully deleted all documents in index {} and type {}",
                          indexName, VERIFY_TYPE );
  
                  return true;


Mime
View raw message