Package org.apache.cassandra.db

Examples of org.apache.cassandra.db.IColumn


                {
                    Collection<IColumn> columns = null;
                    if (superColumnKey_ != null)
                    {
                        // this is the super column case
                        IColumn column = cfamily.getColumn(superColumnKey);
                        if (column != null)
                            columns = column.getSubColumns();
                    }
                    else
                    {
                        columns = cfamily.getAllColumns();
                    }
                   
                    if (columns != null && columns.size() > 0)
                    {
                        if (columns.size() > 1)
                        {
                            // We are looking up by a rowKey & columnKey. There should
                            // be at most one column that matches. If we find more than
                            // one, then it is an internal error.
                            throw new RuntimeException(RuntimeErrorMsg.INTERNAL_ERROR.getMsg("Too many columns found for: " + columnKey));
                        }
                        for (IColumn column : columns)
                        {
                            List<Map<String, String>> rows = new LinkedList<Map<String, String>>();

                            Map<String, String> result = new HashMap<String, String>();
                            result.put(cfMetaData_.n_columnKey, column.name());
                            result.put(cfMetaData_.n_columnValue, new String(column.value()));
                            result.put(cfMetaData_.n_columnTimestamp, Long.toString(column.timestamp()));
                           
                            rows.add(result);
                               
                            // at this point, due to the prior checks, we are guaranteed that
                            // there is only one item in "columns".
View Full Code Here


                  + "    record:" + line);
          errorCount_++;
          continue;
        }

        IColumn clmn = cfamily.getColumn(threadId);
        queryCount_++;
        if (clmn == null) {
          logger_.debug("ERROR Column is missing.....: " + threadId
              + "    record:" + line);
          System.out.println("ERROR Column is missing.....: "
View Full Code Here

      }
      Collection<IColumn> columns = null;
      if( values.length > 1 )
      {
        // this is the super column case
        IColumn column = cfamily.getColumn(values[1]);
        if(column != null)
          columns = column.getSubColumns();
      }
      else
      {
        columns = cfamily.getAllColumns();
      }
View Full Code Here

      }
      Collection<IColumn> columns = null;
      if( values.length > 1 )
      {
        // this is the super column case
        IColumn column = cfamily.getColumn(values[1]);
        if(column != null)
          columns = column.getSubColumns();
      }
      else
      {
        columns = cfamily.getAllColumns();
      }
View Full Code Here

      }
      Collection<IColumn> columns = null;
      if( values.length > 2 )
      {
        // this is the super column case
        IColumn column = cfamily.getColumn(values[1]);
        if(column != null)
          columns = column.getSubColumns();
      }
      else
      {
        columns = cfamily.getAllColumns();
      }
      if (columns == null || columns.size() == 0)
      {
        logger_  .info("ERROR Columns are missing.....: "
                 + "   key:" + key
                + "  ColumnFamily:" + values[0]);
        throw new CassandraException("ERROR Columns are missing.....: " + "   key:" + key + "  ColumnFamily:" + values[0]);
      }

            assert columns.size() == 1;
            IColumn column = columns.iterator().next();
            if (column.isMarkedForDelete())
            {
                return null;
            }
            return new column_t(column.name(), column.value(), column.timestamp());
    }
    catch (Exception ex)
    {
      String exception = LogUtil.throwableToString(ex);
      logger_.info( exception );
View Full Code Here

      }
      Collection<IColumn> columns = null;
      if( values.length > 1 )
      {
        // this is the super column case
        IColumn column = cfamily.getColumn(values[1]);
        if(column != null)
          columns = column.getSubColumns();
      }
      else
      {
        columns = cfamily.getAllColumns();
      }
View Full Code Here

                + "  ColumnFamily:" + values[0]);
        throw new CassandraException("ERROR Columns are missing.....: " + "   key:" + key + "  ColumnFamily:" + values[0]);
      }

            assert columns.size() == 1;
            IColumn column = columns.iterator().next();
            if (column.getSubColumns().size() == 0)
            {
                logger_  .info("ERROR Columns are missing.....: "
                               + "   key:" + key
                                + "  ColumnFamily:" + values[0]);
                throw new CassandraException("ERROR Columns are missing.....: " + "   key:" + key + "  ColumnFamily:" + values[0]);
            }

            return new superColumn_t(column.name(), thriftifyColumns(column.getSubColumns()));
    }
    catch (Exception ex)
    {
      String exception = LogUtil.throwableToString(ex);
      logger_.info( exception );
View Full Code Here

            {
                ColumnDef cdef = itera.next();
                ByteBuffer columnValue = columns.get(ByteBufferUtil.string(cdef.name.duplicate()));
                if (columnValue != null)
                {
                    IColumn column = new Column(cdef.name, columnValue);
                    tuple.set(i, columnToTuple(column, cfDef, UTF8Type.instance));
                }
                else
                    tuple.set(i, TupleFactory.getInstance().newTuple());
                i++;
View Full Code Here

                    Iterator<ByteBuffer> iter = requested.iterator();
                    public IColumn computeNext()
                    {
                        if (!iter.hasNext())
                            return endOfData();
                        IColumn column = cf.getColumn(iter.next());
                        return column == null ? computeNext() : column;
                    }
                };
            }
        };
View Full Code Here

                    {
                        thriftColumns.add(new Column(selector.id().key).setValue(row.key.key).setTimestamp(-1L));
                        continue;
                    }

                    IColumn c = row.cf.getColumn(name.name.key);
                    thriftColumns.add(makeReturnColumn(selector, c));
                }
                cqlRows.add(new CqlRow(row.key.key, thriftColumns));
            }
        }
View Full Code Here

TOP

Related Classes of org.apache.cassandra.db.IColumn

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.