mirror of https://github.com/apache/cassandra
Fix CASSANDRA-6000 and CASSANDRA-5990 merges
This commit is contained in:
parent
7cb57dbcc0
commit
349d5dbead
|
|
@ -936,7 +936,9 @@ public final class CFMetaData
|
|||
for (org.apache.cassandra.thrift.Column column : row.getColumns())
|
||||
columns.put(ByteBufferUtil.string(column.bufferForName()), column.value);
|
||||
}
|
||||
catch (CharacterCodingException ignore) {}
|
||||
catch (CharacterCodingException ignore)
|
||||
{
|
||||
}
|
||||
UntypedResultSet.Row cql3row = new UntypedResultSet.Row(columns);
|
||||
return fromSchemaNoColumnsNoTriggers(cql3row);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,13 +20,7 @@ package org.apache.cassandra.cql3;
|
|||
|
||||
import java.net.InetAddress;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.*;
|
||||
|
||||
import com.google.common.collect.AbstractIterator;
|
||||
|
||||
|
|
@ -77,8 +71,8 @@ public class UntypedResultSet implements Iterable<UntypedResultSet.Row>
|
|||
|
||||
public static class Row
|
||||
{
|
||||
final Map<String, ByteBuffer> data = new HashMap<String, ByteBuffer>();
|
||||
final List<ColumnSpecification> columns;
|
||||
private final Map<String, ByteBuffer> data = new HashMap<>();
|
||||
private final List<ColumnSpecification> columns = new ArrayList<>();
|
||||
|
||||
public Row(Map<String, ByteBuffer> data)
|
||||
{
|
||||
|
|
@ -87,7 +81,7 @@ public class UntypedResultSet implements Iterable<UntypedResultSet.Row>
|
|||
|
||||
public Row(List<ColumnSpecification> names, List<ByteBuffer> columns)
|
||||
{
|
||||
this.columns = names;
|
||||
this.columns.addAll(names);
|
||||
for (int i = 0; i < names.size(); i++)
|
||||
data.put(names.get(i).toString(), columns.get(i));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,27 +22,15 @@ import java.nio.ByteBuffer;
|
|||
import java.nio.charset.CharacterCodingException;
|
||||
import java.util.*;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import org.apache.cassandra.db.Column;
|
||||
import org.apache.cassandra.db.marshal.*;
|
||||
import org.apache.cassandra.exceptions.ConfigurationException;
|
||||
import org.apache.cassandra.exceptions.InvalidRequestException;
|
||||
import org.apache.cassandra.hadoop.*;
|
||||
import org.apache.cassandra.thrift.Cassandra;
|
||||
import org.apache.cassandra.thrift.CfDef;
|
||||
import org.apache.cassandra.thrift.ColumnDef;
|
||||
import org.apache.cassandra.thrift.ColumnOrSuperColumn;
|
||||
import org.apache.cassandra.thrift.Deletion;
|
||||
import org.apache.cassandra.thrift.IndexClause;
|
||||
import org.apache.cassandra.thrift.IndexExpression;
|
||||
import org.apache.cassandra.thrift.IndexOperator;
|
||||
import org.apache.cassandra.thrift.InvalidRequestException;
|
||||
import org.apache.cassandra.thrift.Mutation;
|
||||
import org.apache.cassandra.thrift.SchemaDisagreementException;
|
||||
import org.apache.cassandra.thrift.SlicePredicate;
|
||||
import org.apache.cassandra.thrift.SliceRange;
|
||||
import org.apache.cassandra.thrift.SuperColumn;
|
||||
import org.apache.cassandra.thrift.TimedOutException;
|
||||
import org.apache.cassandra.thrift.UnavailableException;
|
||||
import org.apache.cassandra.thrift.*;
|
||||
import org.apache.cassandra.utils.ByteBufferUtil;
|
||||
import org.apache.cassandra.utils.FBUtilities;
|
||||
import org.apache.cassandra.utils.Hex;
|
||||
|
|
@ -57,8 +45,6 @@ import org.apache.thrift.TDeserializer;
|
|||
import org.apache.thrift.TException;
|
||||
import org.apache.thrift.TSerializer;
|
||||
import org.apache.thrift.protocol.TBinaryProtocol;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* A LoadStoreFunc for retrieving data from and storing data to Cassandra
|
||||
|
|
@ -714,18 +700,10 @@ public class CassandraStorage extends AbstractCassandraStorage
|
|||
|
||||
/** get a list of column for the column family */
|
||||
protected List<ColumnDef> getColumnMetadata(Cassandra.Client client, boolean cql3Table)
|
||||
throws InvalidRequestException,
|
||||
UnavailableException,
|
||||
TimedOutException,
|
||||
SchemaDisagreementException,
|
||||
TException,
|
||||
CharacterCodingException,
|
||||
org.apache.cassandra.exceptions.InvalidRequestException,
|
||||
ConfigurationException,
|
||||
NotFoundException
|
||||
throws TException, CharacterCodingException, InvalidRequestException, ConfigurationException
|
||||
{
|
||||
if (cql3Table)
|
||||
return new ArrayList<ColumnDef>();
|
||||
return new ArrayList<>();
|
||||
|
||||
return getColumnMeta(client, true);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue