Permalink
Browse files

major upgrade

approach to loading table data changed to view
ui polished, especially on tablets
upgrade to latest AndroidCouchbase
  • Loading branch information...
1 parent a798866 commit e1d04686fe1f5c298991efdbba35b886046b01b0 @mschoch mschoch committed Sep 21, 2011
Showing 408 changed files with 4,903 additions and 380 deletions.
View
@@ -1,5 +1,4 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
+<?xml version="1.0" encoding="UTF-8"?><classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
@@ -8,9 +7,9 @@
<classpathentry kind="lib" path="libs/jackson-core-asl-1.8.5.jar"/>
<classpathentry kind="lib" path="libs/jackson-mapper-asl-1.8.5.jar"/>
<classpathentry kind="lib" path="libs/commons-io-2.0.1.jar"/>
- <classpathentry kind="lib" path="libs/org.ektorp-1.2.1.jar"/>
- <classpathentry kind="lib" path="libs/org.ektorp.android-1.2.1.jar"/>
<classpathentry kind="lib" path="libs/slf4j-api-1.6.1.jar"/>
<classpathentry kind="lib" path="libs/slf4j-jdk14-1.6.1.jar"/>
+ <classpathentry kind="lib" path="libs/org.ektorp-1.2.2-SNAPSHOT.jar"/>
+ <classpathentry kind="lib" path="libs/org.ektorp.android-1.2.2-SNAPSHOT.jar"/>
<classpathentry kind="output" path="bin"/>
-</classpath>
+<classpathentry kind="lib" path="libs/OtpErlang.jar"/></classpath>
View
@@ -2,14 +2,12 @@
<uses-sdk android:minSdkVersion="7"/>
<application android:icon="@drawable/icon" android:label="@string/app_name">
- <activity android:name=".AndroidGrocerySyncActivity" android:label="@string/app_name" android:screenOrientation="portrait" android:theme="@android:style/Theme.NoTitleBar" android:configChanges="keyboardHidden|orientation">
+ <activity android:name=".AndroidGrocerySyncActivity" android:label="@string/app_name" android:screenOrientation="portrait" android:theme="@android:style/Theme.NoTitleBar" android:configChanges="keyboardHidden|orientation" android:windowSoftInputMode="stateHidden">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
- <activity android:name="GrocerySyncPreferencesActivity" android:configChanges="keyboardHidden|orientation"/>
-
- <service android:name="com.couchbase.android.CouchbaseService" android:enabled="true" android:exported="false"/></application>
+ <activity android:name="GrocerySyncPreferencesActivity" android:configChanges="keyboardHidden|orientation"/><service android:name="com.couchbase.android.CouchbaseService" android:enabled="true" android:exported="false"/></application>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/><uses-permission android:name="android.permission.INTERNET"/><uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/></manifest>
View
Binary file not shown.
Deleted file not rendered
@@ -0,0 +1,35 @@
+[couchdb]
+database_dir = %couch_data_dir%/db
+view_index_dir = %couch_data_dir%/db
+util_driver_dir = %couch_installation_dir%/
+uri_file = %couch_data_dir%/db/couch.uri
+file_compression = none
+
+[httpd]
+port = 0
+bind_address = 0.0.0.0
+
+[log]
+file = %couch_data_dir%/db/couch.log
+level = debug
+
+[access_log]
+file = %couch_data_dir%/db/couch_access.log
+
+[query_servers]
+javascript = %couch_installation_dir%/couchdb/bin/couchjs_wrapper %couch_installation_dir%/couchdb/share/couchdb/server/main.js
+coffeescript = %couch_installation_dir%/couchdb/bin/couchjs %couch_installation_dir%/couchdb/share/couchdb/server/main-coffee.js
+
+[daemons]
+spatial_manager={couch_spatial, start_link, []}
+
+[httpd_db_handlers]
+_spatial_cleanup = {couch_httpd_spatial, handle_spatial_cleanup_req}
+
+[httpd_design_handlers]
+_spatial = {couch_httpd_spatial, handle_spatial_req}
+_spatial/_list = {couch_httpd_spatial_list, handle_spatial_list_req}
+_spatial/_info = {couch_httpd_spatial, handle_design_info_req}
+_spatial/_compact = {couch_httpd_spatial, handle_compact_req}
+;deprecated API
+_spatiallist = {couch_httpd_spatial_list, handle_spatial_list_req_deprecated}
@@ -0,0 +1,293 @@
+; etc/couchdb/default.ini.tpl. Generated from default.ini.tpl.in by configure.
+
+; Upgrading CouchDB will overwrite this file.
+
+[couchdb]
+database_dir = /data/data/%app_name%/couchdb/var/lib/couchdb
+view_index_dir = /data/data/%app_name%/couchdb/var/lib/couchdb
+util_driver_dir = /data/data/%app_name%/couchdb/lib/couchdb/erlang/lib/couch-1.2.0a-cf776f5-git/priv/lib
+max_document_size = 4294967296 ; 4 GB
+os_process_timeout = 30000 ; 5 seconds. for view and external servers.
+max_dbs_open = 100
+delayed_commits = true ; set this to false to ensure an fsync before 201 Created is returned
+uri_file = /data/data/%app_name%/couchdb/var/run/couchdb/couch.uri
+; Method used to compress everything that is appended to database and view index files, except
+; for attachments (see the attachments section). Available methods are:
+;
+; none - no compression
+; snappy - use google snappy, a very fast compressor/decompressor
+; deflate_[N] - use zlib's deflate, N is the compression level which ranges from 1 (fastest,
+; lowest compression ratio) to 9 (slowest, highest compression ratio)
+file_compression = snappy
+; Maximum number of distinct view update/building processes at any point in time.
+max_parallel_indexers = 4
+
+[database_compaction]
+; larger buffer sizes can originate smaller files
+doc_buffer_size = 524288 ; value in bytes
+checkpoint_after = 5242880 ; checkpoint after every N bytes were written
+
+[view_compaction]
+; larger buffer sizes can originate smaller files
+keyvalue_buffer_size = 2097152 ; value in bytes
+
+[httpd]
+port = 5984
+bind_address = 127.0.0.1
+authentication_handlers = {couch_httpd_oauth, oauth_authentication_handler}, {couch_httpd_auth, cookie_authentication_handler}, {couch_httpd_auth, default_authentication_handler}
+default_handler = {couch_httpd_db, handle_request}
+secure_rewrites = true
+vhost_global_handlers = _utils, _uuids, _session, _oauth, _users
+allow_jsonp = false
+db_frontend = couch_db_frontend
+; Options for the MochiWeb HTTP server.
+;server_options = [{backlog, 128}, {acceptor_pool_size, 16}]
+; For more socket options, consult Erlang's module 'inet' man page.
+;socket_options = [{recbuf, 262144}, {sndbuf, 262144}, {nodelay, true}]
+
+[ssl]
+port = 6984
+
+[log]
+file = /data/data/%app_name%/couchdb/var/log/couchdb/couch.log
+level = info
+include_sasl = true
+
+; Enable apache httpd-style access logging.
+; The default format is the "extended" or "combined" format that
+; includes:
+; host ident authuser date request status bytes referer(sic) user-agent
+;
+; The alternative format is "common" that includes:
+; host ident authuser date request status bytes
+;
+; If a value is not defined, the log entry will be " - " for that value.
+
+[access_log]
+enable = false
+format = extended
+file = /data/data/%app_name%/couchdb/var/log/couchdb/couch_access.log
+
+[couch_httpd_auth]
+authentication_db = _users
+authentication_redirect = /_utils/session.html
+require_valid_user = false
+timeout = 600 ; number of seconds before automatic logout
+auth_cache_size = 50 ; size is number of cache entries
+
+[query_servers]
+javascript = /data/data/%app_name%/couchdb/bin/couchjs /data/data/%app_name%/couchdb/share/couchdb/server/main.js
+coffeescript = /data/data/%app_name%/couchdb/bin/couchjs /data/data/%app_name%/couchdb/share/couchdb/server/main-coffee.js
+
+
+; Changing reduce_limit to false will disable reduce_limit.
+; If you think you're hitting reduce_limit with a "good" reduce function,
+; please let us know on the mailing list so we can fine tune the heuristic.
+[query_server_config]
+reduce_limit = true
+os_process_limit = 50
+
+[daemons]
+view_manager={couch_view, start_link, []}
+external_manager={couch_external_manager, start_link, []}
+query_servers={couch_query_servers, start_link, []}
+vhosts={couch_httpd_vhost, start_link, []}
+httpd={couch_httpd, start_link, []}
+;stats_aggregator={couch_stats_aggregator, start, []}
+;stats_collector={couch_stats_collector, start, []}
+uuids={couch_uuids, start, []}
+auth_cache={couch_auth_cache, start_link, []}
+replication_manager={couch_replication_manager, start_link, []}
+os_daemons={couch_os_daemons, start_link, []}
+compaction_daemon={couch_compaction_daemon, start_link, []}
+
+[httpd_global_handlers]
+/ = {couch_httpd_misc_handlers, handle_welcome_req, <<"Welcome">>}
+favicon.ico = {couch_httpd_misc_handlers, handle_favicon_req, "/data/data/%app_name%/couchdb/share/couchdb/www"}
+
+_utils = {couch_httpd_misc_handlers, handle_utils_dir_req, "/data/data/%app_name%/couchdb/share/couchdb/www"}
+_all_dbs = {couch_httpd_misc_handlers, handle_all_dbs_req}
+_active_tasks = {couch_httpd_misc_handlers, handle_task_status_req}
+_config = {couch_httpd_misc_handlers, handle_config_req}
+_replicate = {couch_httpd_replicator, handle_req}
+_uuids = {couch_httpd_misc_handlers, handle_uuids_req}
+_restart = {couch_httpd_misc_handlers, handle_restart_req}
+;_stats = {couch_httpd_stats_handlers, handle_stats_req}
+_log = {couch_httpd_misc_handlers, handle_log_req}
+_session = {couch_httpd_auth, handle_session_req}
+_oauth = {couch_httpd_oauth, handle_oauth_req}
+_generate_load = {couch_internal_load_gen, handle_req}
+_view_merge = {couch_httpd_view_merger, handle_req}
+
+[httpd_db_handlers]
+_view_cleanup = {couch_httpd_db, handle_view_cleanup_req}
+_compact = {couch_httpd_db, handle_compact_req}
+_design = {couch_httpd_db, handle_design_req}
+_temp_view = {couch_httpd_view, handle_temp_view_req}
+_changes = {couch_httpd_db, handle_changes_req}
+
+; The external module takes an optional argument allowing you to narrow it to a
+; single script. Otherwise the script name is inferred from the first path section
+; after _external's own path.
+; _mypath = {couch_httpd_external, handle_external_req, <<"mykey">>}
+; _external = {couch_httpd_external, handle_external_req}
+
+[httpd_design_handlers]
+_view = {couch_httpd_view, handle_view_req}
+_show = {couch_httpd_show, handle_doc_show_req}
+_list = {couch_httpd_show, handle_view_list_req}
+_info = {couch_httpd_db, handle_design_info_req}
+_rewrite = {couch_httpd_rewrite, handle_rewrite_req}
+_update = {couch_httpd_show, handle_doc_update_req}
+
+; enable external as an httpd handler, then link it with commands here.
+; note, this api is still under consideration.
+; [external]
+; mykey = /path/to/mycommand
+
+; Here you can setup commands for CouchDB to manage
+; while it is alive. It will attempt to keep each command
+; alive if it exits.
+; [os_daemons]
+; some_daemon_name = /path/to/script -with args
+
+
+[uuids]
+; Known algorithms:
+; random - 128 bits of random awesome
+; All awesome, all the time.
+; sequential - monotonically increasing ids with random increments
+; First 26 hex characters are random. Last 6 increment in
+; random amounts until an overflow occurs. On overflow, the
+; random prefix is regenerated and the process starts over.
+; utc_random - Time since Jan 1, 1970 UTC with microseconds
+; First 14 characters are the time in hex. Last 18 are random.
+algorithm = sequential
+
+[stats]
+; rate is in milliseconds
+rate = 1000
+; sample intervals are in seconds
+samples = [0, 60, 300, 900]
+
+[attachments]
+compression_level = 8 ; from 1 (lowest, fastest) to 9 (highest, slowest), 0 to disable compression
+compressible_types = text/*, application/javascript, application/json, application/xml
+
+[replicator]
+db = _replicator
+; Maximum replicaton retry count can be a non-negative integer or "infinity".
+max_replication_retry_count = 10
+; More worker processes can give higher network throughput but can also
+; imply more disk and network IO.
+worker_processes = 4
+; With lower batch sizes checkpoints are done more frequently. Lower batch sizes
+; also reduce the total amount of used RAM memory.
+worker_batch_size = 500
+; Maximum number of HTTP connections per replication.
+http_connections = 20
+; HTTP connection timeout per replication.
+; Even for very fast/reliable networks it might need to be increased if a remote
+; database is too busy.
+connection_timeout = 30000
+; Some socket options that might boost performance in some scenarios:
+; {nodelay, boolean()}
+; {sndbuf, integer()}
+; {recbuf, integer()}
+; {priority, integer()}
+; See the `inet` Erlang module's man page for the full list of options.
+socket_options = [{keepalive, true}, {nodelay, false}]
+; set to true to validate peer certificates
+verify_ssl_certificates = false
+; file containing a list of peer trusted certificates (PEM format)
+; ssl_trusted_certificates_file = /etc/ssl/certs/ca-certificates.crt
+; maximum peer certificate depth (must be set even if certificate validation is off)
+ssl_certificate_max_depth = 3
+
+[compaction_daemon]
+; The delay, in seconds, between each check for which database and view indexes
+; need to be compacted.
+check_interval = 60
+; If a database or view index file is smaller then this value (in bytes),
+; compaction will not happen. Very small files always have a very high
+; fragmentation therefore it's not worth to compact them.
+min_file_size = 131072
+
+[compactions]
+; List of compaction rules for the compaction daemon.
+; The daemon compacts databases and their respective view groups when all the
+; condition parameters are satisfied. Configuration can be per database or
+; global, and it has the following format:
+;
+; database_name = [ {ParamName, ParamValue}, {ParamName, ParamValue}, ... ]
+; _default = [ {ParamName, ParamValue}, {ParamName, ParamValue}, ... ]
+;
+; Possible parameters:
+;
+; * db_fragmentation - If the ratio (as an integer percentage), of the amount
+; of old data (and its supporting metadata) over the database
+; file size is equal to or greater then this value, this
+; database compaction condition is satisfied.
+; This value is computed as:
+;
+; (file_size - data_size) / file_size * 100
+;
+; The data_size and file_size values can be obtained when
+; querying a database's information URI (GET /dbname/).
+;
+; * view_fragmentation - If the ratio (as an integer percentage), of the amount
+; of old data (and its supporting metadata) over the view
+; index (view group) file size is equal to or greater then
+; this value, then this view index compaction condition is
+; satisfied. This value is computed as:
+;
+; (file_size - data_size) / file_size * 100
+;
+; The data_size and file_size values can be obtained when
+; querying a view group's information URI
+; (GET /dbname/_design/groupname/_info).
+;
+; * from _and_ to - The period for which a database (and its view groups) compaction
+; is allowed. The value for these parameters must obey the format:
+;
+; HH:MM - HH:MM (HH in [0..23], MM in [0..59])
+;
+; * strict_window - If a compaction is still running after the end of the allowed
+; period, it will be canceled if this parameter is set to 'true'.
+; It defaults to 'false' and it's meaningful only if the *period*
+; parameter is also specified.
+;
+; * parallel_view_compaction - If set to 'true', the database and its views are
+; compacted in parallel. This is only useful on
+; certain setups, like for example when the database
+; and view index directories point to different
+; disks. It defaults to 'false'.
+;
+; Before a compaction is triggered, an estimation of how much free disk space is
+; needed is computed. This estimation corresponds to 2 times the data size of
+; the database or view index. When there's not enough free disk space to compact
+; a particular database or view index, a warning message is logged.
+;
+; Examples:
+;
+; 1) [{db_fragmentation, "70%"}, {view_fragmentation, "60%"}]
+; The `foo` database is compacted if its fragmentation is 70% or more.
+; Any view index of this database is compacted only if its fragmentation
+; is 60% or more.
+;
+; 2) [{db_fragmentation, "70%"}, {view_fragmentation, "60%"}, {from, "00:00"}, {to, "04:00"}]
+; Similar to the preceding example but a compaction (database or view index)
+; is only triggered if the current time is between midnight and 4 AM.
+;
+; 3) [{db_fragmentation, "70%"}, {view_fragmentation, "60%"}, {from, "00:00"}, {to, "04:00"}, {strict_window, true}]
+; Similar to the preceding example - a compaction (database or view index)
+; is only triggered if the current time is between midnight and 4 AM. If at
+; 4 AM the database or one of its views is still compacting, the compaction
+; process will be canceled.
+;
+; 4) [{db_fragmentation, "70%"}, {view_fragmentation, "60%"}, {from, "00:00"}, {to, "04:00"}, {strict_window, true}, {parallel_view_compaction, true}]
+; Similar to the preceding example, but a database and its views can be
+; compacted in parallel.
+;
+;_default = [{db_fragmentation, "70%"}, {view_fragmentation, "60%"}, {from, "23:00"}, {to, "04:00"}]
+
Oops, something went wrong.

0 comments on commit e1d0468

Please sign in to comment.