Skip to content

Commit

Permalink
merge from 0.8
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/cassandra/trunk@1095139 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
jbellis committed Apr 19, 2011
1 parent e771943 commit 1adcd1c
Show file tree
Hide file tree
Showing 64 changed files with 967 additions and 245 deletions.
3 changes: 2 additions & 1 deletion .rat-excludes
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
debian/**
.classpath
.rat-excludes
.project
**/.project
**/.pydevproject
CHANGES.txt
.git/**
**/*.json
Expand Down
6 changes: 4 additions & 2 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
0.8-dev
0.8.0-beta1
* remove Avro RPC support (CASSANDRA-926)
* adds support for columns that act as incr/decr counters
(CASSANDRA-1072, 1937, 1944, 1936, 2101, 2093, 2288, 2105, 2384, 2236, 2342,
2454)
* CQL (CASSANDRA-1703, 1704, 1705, 1706, 1707, 1708, 1710, 1711, 1940,
2124, 2302, 2277)
2124, 2302, 2277, 2493)
* avoid double RowMutation serialization on write path (CASSANDRA-1800)
* make NetworkTopologyStrategy the default (CASSANDRA-1960)
* configurable internode encryption (CASSANDRA-1567, 2152)
Expand Down Expand Up @@ -55,6 +55,8 @@
* Try harder to close files after compaction (CASSANDRA-2431)
* re-set bootstrapped flag after move finishes (CASSANDRA-2435)
* use 64KB flush buffer instead of in_memory_compaction_limit (CASSANDRA-2463)
* fix duplicate results from CFS.scan (CASSANDRA-2406)
* avoid caching token-only decoratedkeys (CASSANDRA-2416)


0.7.4
Expand Down
31 changes: 22 additions & 9 deletions NEWS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,29 @@

Upgrading
---------
Avro record classes used in map/reduce and Hadoop streaming code have
moved from org.apache.cassandra.avro to org.apache.cassandra.hadoop.avro,
applications using these classes will need to be updated accordingly.
- Upgrading from version 0.7.1 or later can be done with a rolling
restart, one node at a time. You do not need to bring down the
whole cluster.
- Avro record classes used in map/reduce and Hadoop streaming code have
moved from org.apache.cassandra.avro to org.apache.cassandra.hadoop.avro,
applications using these classes will need to be updated accordingly.
- The loadbalance command has been removed from nodetool. For similar
behavior, decommission then rebootstrap with empty initial_token.
- repair now works on a token range, rather than the entire ring. This
means that "run repair against each node" will now repair the ring with
no redundant work.

Upgrading from version 0.7.1 or later can be done with a rolling restart,
one node at a time. You do not need to bring down the whole cluster.

The loadbalance command has been removed from nodetool. For similar
behavior, decommission then rebootstrap with empty initial_token.
Features
--------
- added CQL client API and JDBC/DBAPI2-compliant drivers for Java and
Python, respectively (see: drivers/ subdirectory and doc/cql)
- added distributed Counters feature;
see http://wiki.apache.org/cassandra/Counters
- optional intranode encryption; see comments around 'encryption_options'
in cassandra.yaml
- compaction multithreading and rate-limiting; see
'compaction_multithreading' and 'compaction_throughput_mb_per_sec' in
cassandra.yaml

Other
-----
Expand Down Expand Up @@ -55,7 +69,6 @@ Upgrading
data files before rebuilding, just in case.


>>>>>>> .merge-right.r1073884
0.7.1
=====

Expand Down
2 changes: 1 addition & 1 deletion build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
<property name="test.long.src" value="${test.dir}/long"/>
<property name="test.distributed.src" value="${test.dir}/distributed"/>
<property name="dist.dir" value="${build.dir}/dist"/>
<property name="base.version" value="0.8.0"/>
<property name="base.version" value="0.8.0-beta1"/>
<property name="cql.driver.version" value="1.0.0" />
<condition property="version" value="${base.version}">
<isset property="release"/>
Expand Down
2 changes: 1 addition & 1 deletion conf/cassandra.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ in_memory_compaction_limit_in_mb: 64
# Enables multiple compactions to execute at once. This is highly recommended
# for preserving read performance in a mixed read/write workload as this
# avoids sstables from accumulating during long running compactions.
compaction_multithreading: true
compaction_multithreading: false

# Throttles compaction to the given total throughput across the entire
# system. The faster you insert data, the faster you need to compact in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,19 +56,19 @@
import org.apache.thrift.transport.TTransportException;

/**
* A LoadFunc wrapping ColumnFamilyInputFormat.
* A LoadStoreFunc for retrieving data from and storing data to Cassandra
*
* A row from a standard CF will be returned as nested tuples: (key, ((name1, val1), (name2, val2))).
*/
public class CassandraStorage extends LoadFunc implements StoreFuncInterface, LoadPushDown
public class CassandraStorage extends LoadFunc implements StoreFuncInterface
{
// system environment variables that can be set to configure connection info:
// alternatively, Hadoop JobConf variables can be set using keys from ConfigHelper
public final static String PIG_RPC_PORT = "PIG_RPC_PORT";
public final static String PIG_INITIAL_ADDRESS = "PIG_INITIAL_ADDRESS";
public final static String PIG_PARTITIONER = "PIG_PARTITIONER";

private static String UDFCONTEXT_SCHEMA_KEY = "cassandra.schema";
private static String UDFCONTEXT_SCHEMA_KEY_PREFIX = "cassandra.schema";

private final static ByteBuffer BOUND = ByteBufferUtil.EMPTY_BYTE_BUFFER;
private static final Log logger = LogFactory.getLog(CassandraStorage.class);
Expand Down Expand Up @@ -169,7 +169,7 @@ private CfDef getCfDef()
{
UDFContext context = UDFContext.getUDFContext();
Properties property = context.getUDFProperties(CassandraStorage.class);
return cfdefFromString(property.getProperty(UDFCONTEXT_SCHEMA_KEY));
return cfdefFromString(property.getProperty(getSchemaContextKey()));
}

private List<AbstractType> getDefaultMarshallers(CfDef cfDef) throws IOException
Expand Down Expand Up @@ -226,7 +226,7 @@ public void prepareToRead(RecordReader reader, PigSplit split)
this.reader = reader;
}

private void setLocationFromUri(String location) throws IOException
private void setLocationFromUri(String location) throws IOException
{
// parse uri into keyspace and columnfamily
String names[];
Expand Down Expand Up @@ -396,7 +396,7 @@ public void putNext(Tuple t) throws ExecException, IOException
if (validators.get(column.name) == null)
// Have to special case BytesType to convert DataByteArray into ByteBuffer
if (marshallers.get(1) instanceof BytesType)
column.value = ByteBuffer.wrap(((DataByteArray) pair.get(1)).get());
column.value = objToBB(pair.get(1));
else
column.value = marshallers.get(1).decompose(pair.get(1));
else
Expand Down Expand Up @@ -428,27 +428,16 @@ public void cleanupOnFailure(String failure, Job job)
{
}

/* LoadPushDown methods */

public List<OperatorSet> getFeatures() {
return Arrays.asList(LoadPushDown.OperatorSet.PROJECTION);
}

public RequiredFieldResponse pushProjection(RequiredFieldList requiredFieldList) throws FrontendException
{
return new RequiredFieldResponse(true);
}


/* Methods to get the column family schema from Cassandra */

private void initSchema()
{
UDFContext context = UDFContext.getUDFContext();
Properties property = context.getUDFProperties(CassandraStorage.class);


String schemaContextKey = getSchemaContextKey();
// Only get the schema if we haven't already gotten it
if (!property.containsKey(UDFCONTEXT_SCHEMA_KEY))
if (!property.containsKey(schemaContextKey))
{
Cassandra.Client client = null;
try
Expand All @@ -466,7 +455,7 @@ private void initSchema()
break;
}
}
property.setProperty(UDFCONTEXT_SCHEMA_KEY, cfdefToString(cfDef));
property.setProperty(schemaContextKey, cfdefToString(cfDef));
}
catch (TException e)
{
Expand Down Expand Up @@ -532,4 +521,14 @@ private static CfDef cfdefFromString(String st)
}
return cfDef;
}

private String getSchemaContextKey()
{
StringBuilder sb = new StringBuilder(UDFCONTEXT_SCHEMA_KEY_PREFIX);
sb.append('.');
sb.append(keyspace);
sb.append('.');
sb.append(column_family);
return sb.toString();
}
}
1 change: 0 additions & 1 deletion debian/cassandra.install
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,5 @@ bin/clustertool usr/bin
bin/json2sstable usr/bin
bin/sstable2json usr/bin
bin/sstablekeys usr/bin
bin/schematool usr/bin
lib/*.jar usr/share/cassandra
lib/licenses usr/share/doc/cassandra
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
cassandra (0.8.0~beta1) unstable; urgency=low

* New beta release.

-- Eric Evans <eevans@apache.org> Mon, 18 Apr 2011 11:41:09 -0500

cassandra (0.7.4) unstable; urgency=low

* New stable point release.
Expand Down
23 changes: 22 additions & 1 deletion doc/cql/CQL.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. 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.
-->

<?xml version='1.0' encoding='utf-8' ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/></head><body><h1 id="CassandraQueryLanguageCQLv1.0.0">Cassandra Query Language (CQL) v1.0.0</h1><h2 id="TableofContents">Table of Contents</h2><ol style="list-style: none;"><li><a href="#CassandraQueryLanguageCQLv1.0.0">Cassandra Query Language (CQL) v1.0.0</a><ol style="list-style: none;"><li><a href="#TableofContents">Table of Contents</a></li><li><a href="#USE">USE</a></li><li><a href="#SELECT">SELECT</a><ol style="list-style: none;"><li><a href="#SpecifyingColumns">Specifying Columns</a></li><li><a href="#ColumnFamily">Column Family</a></li><li><a href="#ConsistencyLevel">Consistency Level</a></li><li><a href="#Filteringrows">Filtering rows</a></li><li><a href="#Limits">Limits</a></li></ol></li><li><a href="#UPDATE">UPDATE</a><ol style="list-style: none;"><li><a href="#ColumnFamily2">Column Family</a></li><li><a href="#ConsistencyLevel2">Consistency Level</a></li><li><a href="#SpecifyingColumnsandRow">Specifying Columns and Row</a></li></ol></li><li><a href="#DELETE">DELETE</a><ol style="list-style: none;"><li><a href="#SpecifyingColumns2">Specifying Columns</a></li><li><a href="#ColumnFamily3">Column Family</a></li><li><a href="#ConsistencyLevel3">Consistency Level</a></li><li><a href="#deleterows">Specifying Rows</a></li></ol></li><li><a href="#TRUNCATE">TRUNCATE</a></li><li><a href="#CREATEKEYSPACE">CREATE KEYSPACE</a></li><li><a href="#CREATECOLUMNFAMILY">CREATE COLUMNFAMILY</a><ol style="list-style: none;"><li><a href="#keytypes">Specifying Key Type</a></li><li><a href="#columntypes">Specifying Column Type (optional)</a></li><li><a href="#ColumnFamilyOptionsoptional">Column Family Options (optional)</a></li></ol></li><li><a href="#CREATEINDEX">CREATE INDEX</a></li><li><a href="#DROP">DROP</a></li><li><a href="#CommonIdioms">Common Idioms</a><ol style="list-style: none;"><li><a href="#consistency">Specifying Consistency</a></li><li><a href="#terms">Term specification</a></li></ol></li></ol></li><li><a href="#Versioning">Versioning</a></li><li><a href="#Changes">Changes</a></li></ol><h2 id="USE">USE</h2><p><i>Synopsis:</i></p><pre><code>USE &lt;KEYSPACE&gt;;
</code></pre><p>A <code>USE</code> statement consists of the <code>USE</code> keyword, followed by a valid keyspace name. Its purpose is to assign the per-connection, current working keyspace. All subsequent keyspace-specific actions will be performed in the context of the supplied value.</p><h2 id="SELECT">SELECT</h2><p><i>Synopsis:</i></p><pre><code>SELECT [FIRST N] [REVERSED] &lt;SELECT EXPR&gt; FROM &lt;COLUMN FAMILY&gt; [USING &lt;CONSISTENCY&gt;]
[WHERE &lt;CLAUSE&gt;] [LIMIT N];
Expand Down Expand Up @@ -39,4 +60,4 @@
</code></pre><p><code>DROP</code> statements result in the immediate, irreversible removal of keyspace and column family namespaces.</p><h2 id="CommonIdioms">Common Idioms</h2><h3 id="consistency">Specifying Consistency</h3><pre><code>... USING &lt;CONSISTENCY&gt; ...
</code></pre><p>Consistency level specifications are made up the keyword <code>USING</code>, followed by a consistency level identifier. Valid consistency levels are as follows:</p><ul><li><code>CONSISTENCY ZERO</code></li><li><code>CONSISTENCY ONE</code> (default)</li><li><code>CONSISTENCY QUORUM</code></li><li><code>CONSISTENCY ALL</code></li><li><code>CONSISTENCY DCQUORUM</code></li><li><code>CONSISTENCY DCQUORUMSYNC</code></li></ul><h3 id="terms">Term specification</h3><p>Terms are used in statements to specify things such as keyspaces, column families, indexes, column names and values, and keyword arguments. The rules governing term specification are as follows:</p><ul><li>Any single quoted string literal (example: <code>'apple'</code>).</li><li>Unquoted alpha-numeric strings that begin with a letter (example: <code>carrot</code>).</li><li>Unquoted numeric literals (example: <code>100</code>).</li><li>UUID strings in hyphen-delimited hex notation (example: <code>1438fc5c-4ff6-11e0-b97f-0026c650d722</code>). </li></ul><p>Terms which do not conform to these rules result in an exception.</p><p>How column name/value terms are interpreted is determined by the configured type.</p><table><tr><th>type</th><th>term</th></tr><tr><td>ascii</td><td>Any string which can be decoded using ASCII charset</td></tr><tr><td>text / varchar</td><td>Any string which can be decoded using UTF8 charset</td></tr><tr><td>uuid</td><td>Standard UUID string format (hyphen-delimited hex notation)</td></tr><tr><td>uuid</td><td>Standard UUID string format (hyphen-delimited hex notation)</td></tr><tr><td>uuid</td><td>The string <code>now</code>, to represent a type-1 (time-based) UUID with a date-time component based on the current time</td></tr><tr><td>uuid</td><td>Numeric value representing milliseconds since epoch</td></tr><tr><td>uuid</td><td>An <a href="http://en.wikipedia.org/wiki/8601">iso8601 timestamp</a></td></tr><tr><td>bigint</td><td>Numeric value capable of fitting in 8 bytes</td></tr><tr><td>varint</td><td>Numeric value of arbitrary size</td></tr><tr><td>bytea</td><td>Hex-encoded strings (converted directly to the corresponding bytes)</td></tr></table><h1 id="Versioning">Versioning</h1><p>Versioning of the CQL language adheres to the <a href="http://semver.org">Semantic Versioning</a> guidelines. Versions take the form X.Y.Z where X, Y, and Z are integer values representing major, minor, and patch level respectively. There is no correlation between Cassandra release versions and the CQL language version.</p><table><tr><th>version</th><th>description</th></tr><tr><td>Patch</td><td>The patch version is incremented when bugs are fixed.</td></tr><tr><td>Minor</td><td>Minor version increments occur when new, but backward compatible, functionality is introduced.</td></tr><tr><td>Major</td><td>The major version <em>must</em> be bumped when backward incompatible changes are introduced. This should rarely (if ever) occur.</td></tr></table><h1 id="Changes">Changes</h1><pre>Tue, 22 Mar 2011 18:10:28 -0700 - Eric Evans &lt;eevans@rackspace.com&gt;
* Initial version, 1.0.0
</pre></body></html>
</pre></body></html>
Original file line number Diff line number Diff line change
@@ -1,4 +1,25 @@
package org.apache.cassandra.cql.jdbc;
/*
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. 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.
*
*/


import org.apache.cassandra.db.marshal.*;

Expand Down
Loading

0 comments on commit 1adcd1c

Please sign in to comment.