Package org.apache.cassandra.db

Examples of org.apache.cassandra.db.ColumnFamily


        List<Row> rows;
        try
        {
            rows = StorageProxy.read(commands, rConsistecy);
            Row row = rows.get(0);
            ColumnFamily cf = row.cf;

            int bytes = 0;
            StringBuffer response = new StringBuffer();
            if (cf != null)
            {
                for (IColumn col : cf.getSortedColumns())
                {
                    String value = SystemUtils.convertToString(valser, col.value());
                    response.append(colser.fromByteBuffer(col.name())).append(":").append(value);
                    bytes += col.name().capacity();
                    bytes += col.value().capacity();
View Full Code Here


        List<Row> rows;
        try
        {
            rows = StorageProxy.read(commands, rConsistecy);
            Row row = rows.get(0);
            ColumnFamily cf = row.cf;

            int bytes = 0;
            StringBuffer response = new StringBuffer();
            if (cf != null)
            {
                for (IColumn col : cf.getSortedColumns())
                {
                    String value = SystemUtils.convertToString(valser, col.value());
                    response.append(colser.fromByteBuffer(col.name())).append(":").append(value);
                    bytes += col.name().capacity();
                    bytes += col.value().capacity();
View Full Code Here

        list.add("SuperColumn-189");
        list.add("SuperColumn-23");
        Row row = table.getRow("0", "MailboxMailData0", list);
        try
        {
            ColumnFamily cf = row.getColumnFamily("MailboxMailData0");
            Collection<IColumn> columns = cf.getAllColumns();           
            for ( IColumn column : columns )
            {               
                System.out.println(column.name());               
                Collection<IColumn> subColumns = column.getSubColumns();
                for ( IColumn subColumn : subColumns )
View Full Code Here

        byte[] bytes = new byte[(int)(fis.length() - fis.getFilePointer())];
        fis.readFully(bytes);
        DataInputBuffer bufIn = new DataInputBuffer();
        bufIn.reset(bytes, bytes.length);
       
        ColumnFamily cf = ColumnFamily.serializer().deserialize(bufIn);       
        Collection<IColumn> columns = cf.getAllColumns();      
        System.out.println(columns.size());
        for ( IColumn column : columns )
        {
            System.out.println(column.name());
        }
View Full Code Here

        if (row != null)
        {
            Map<String, ColumnFamily> cfMap = row.getColumnFamilyMap();
            if (cfMap != null && cfMap.size() > 0)
            {
                ColumnFamily cfamily = cfMap.get(cfMetaData_.cfName);
                if (cfamily != null)
                {
                    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)
                    {
                        for (IColumn column : columns)
View Full Code Here

        if (row != null)
        {
            Map<String, ColumnFamily> cfMap = row.getColumnFamilyMap();
            if (cfMap != null && cfMap.size() > 0)
            {
                ColumnFamily cfamily = cfMap.get(cfMetaData_.cfName);
                if (cfamily != null)
                {
                    Collection<IColumn> columns = cfamily.getAllColumns();
                    if (columns != null && columns.size() > 0)
                    {
                        for (IColumn column : columns)
                        {
                            Collection<IColumn> subColumns = column.getSubColumns();
View Full Code Here

        if (row != null)
        {
            Map<String, ColumnFamily> cfMap = row.getColumnFamilyMap();
            if (cfMap != null && cfMap.size() > 0)
            {
                ColumnFamily cfamily = cfMap.get(cfMetaData_.cfName);
                if (cfamily != null)
                {
                    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)
View Full Code Here

        new FileInputStream(filepath)), 16 * 1024 * 1024);
    String line = null;
    String delimiter_ = new String(",");
    RowMutationMessage rmInbox = null;
    RowMutationMessage rmOutbox = null;
    ColumnFamily cfInbox = null;
    ColumnFamily cfOutbox = null;
    while ((line = bufReader.readLine()) != null) {
      StringTokenizer st = new StringTokenizer(line, delimiter_);
      int i = 0;
      String threadId = null;
      int lastUpdated = 0;
      int isDeleted = 0;
      int folder = 0;
      String user = null;
      while (st.hasMoreElements()) {
        switch (i) {
        case 0:
          user = (String) st.nextElement();// sb.append((String)st.nextElement());
          break;

        case 1:
          folder = Integer.parseInt((String) st.nextElement());// sb.append((String)st.nextElement());
          break;

        case 2:
          threadId = (String) st.nextElement();
          break;

        case 3:
          lastUpdated = Integer.parseInt((String) st.nextElement());
          break;

        case 4:
          isDeleted = Integer.parseInt((String) st.nextElement());// (String)st.nextElement();
          break;

        default:
          break;
        }
        ++i;
      }
      String key = null;
      if (folder == 0) {
        key = user + ":0";
      } else {
        key = user + ":1";
      }

      ReadCommand readCommand = new ReadCommand(tablename_, key);
      Message message = new Message(from_, StorageService.readStage_,
          StorageService.readVerbHandler_,
          new Object[] {readCommand});
      IAsyncResult iar = MessagingService.getMessagingInstance().sendRR(
          message, to_);
      Object[] result = iar.get();
      ReadResponse readResponse = (ReadResponse) result[0];
      Row row = readResponse.row();
      if (row == null) {
        logger_.debug("ERROR No row for this key .....: " + line);
                Thread.sleep(1000/requestsPerSecond_, 1000%requestsPerSecond_);
        errorCount_++;
      } else {
        Map<String, ColumnFamily> cfMap = row.getColumnFamilyMap();
        if (cfMap == null || cfMap.size() == 0) {
          logger_
              .debug("ERROR ColumnFamil map is missing.....: "
                  + threadId + "   key:" + key
                  + "    record:" + line);
          System.out
              .println("ERROR ColumnFamil map is missing.....: "
                  + threadId + "   key:" + key
                  + "    record:" + line);
          errorCount_++;
          continue;
        }
        ColumnFamily cfamily = cfMap.get(columnFamily_);
        if (cfamily == null) {
          logger_
              .debug("ERROR ColumnFamily  is missing.....: "
                  + threadId + "   key:" + key
                  + "    record:" + line);
          System.out
              .println("ERROR ColumnFamily  is missing.....: "
                  + threadId + "   key:" + key
                  + "    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

        new FileInputStream(filepath)), 16 * 1024 * 1024);
    String line = null;
    String delimiter_ = new String(",");
    RowMutationMessage rmInbox = null;
    RowMutationMessage rmOutbox = null;
    ColumnFamily cfInbox = null;
    ColumnFamily cfOutbox = null;
    String firstuser = null ;
    String nextuser = null;
    while ((line = bufReader.readLine()) != null) {
      StringTokenizer st = new StringTokenizer(line, delimiter_);
      int i = 0;
View Full Code Here

        new FileInputStream(filepath)), 16 * 1024 * 1024);
    String line = null;
    String delimiter_ = new String(",");
    RowMutationMessage rmInbox = null;
    RowMutationMessage rmOutbox = null;
    ColumnFamily cfInbox = null;
    ColumnFamily cfOutbox = null;
    String firstuser = null ;
    String nextuser = null;
    while ((line = bufReader.readLine()) != null) {
      StringTokenizer st = new StringTokenizer(line, delimiter_);
      int i = 0;
View Full Code Here

TOP

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

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.