Examples of batch_mutation_t


Examples of org.apache.cassandra.service.batch_mutation_t

    {
      for(int key = 1; key <= keys ; key++)
      {
              String stringKey = new Integer(key).toString();
              stringKey = stringKey + keyFix_ ;
              batch_mutation_t bt = new batch_mutation_t();
              bt.key = stringKey;
              bt.table = tablename_;
              bt.cfmap = new HashMap<String,List<column_t>>();
              ArrayList<column_t> column_arr = new ArrayList<column_t>();
              for( int j = 1; j <= columns ; j++)
View Full Code Here

Examples of org.apache.cassandra.service.batch_mutation_t

        new FileInputStream(filepath)), 16 * 1024 * 1024);
    String line = null;
    String delimiter_ = new String(",");
    String firstuser = null;
    String nextuser = null;
    batch_mutation_t rmInbox = null;
    batch_mutation_t rmOutbox = 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;
      int uid =0;
      String user = null;
      while (st.hasMoreElements()) {
        switch (i) {
        case 0:
          user = (String) st.nextElement();// sb.append((String)st.nextElement());
                    if ( !isNumeric(user))
                        continue;
         
          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;
      }

      nextuser = user;
      if (firstuser == null || firstuser.compareTo(nextuser) != 0) {
        firstuser = nextuser;
        if (rmInbox != null && !rmInbox.cfmap.isEmpty()) {
/*          fos_.write(rmInbox.key.getBytes());
          fos_.write( System.getProperty("line.separator").getBytes());
                  counter_.incrementAndGet();
*/          apply(rmInbox);
        }
        if (rmOutbox != null && !rmOutbox.cfmap.isEmpty()) {
/*          fos_.write(rmOutbox.key.getBytes());
          fos_.write( System.getProperty("line.separator").getBytes());
                  counter_.incrementAndGet();
*/          apply(rmOutbox);
        }
        rmInbox = new batch_mutation_t();
        rmInbox.table = "Mailbox";
        rmInbox.key = firstuser + ":0";
        rmInbox.cfmap = new HashMap<String, List<column_t>>();

        rmOutbox = new batch_mutation_t();
        rmOutbox.table = "Mailbox";
        rmOutbox.key = firstuser + ":1";
        rmOutbox.cfmap = new HashMap<String, List<column_t>>();
      }
      column_t columnData = new column_t();
View Full Code Here

Examples of org.apache.cassandra.service.batch_mutation_t

        new FileInputStream(filepath)), 16 * 1024 * 1024);
    String line = null;
    String delimiter_ = new String(",");
    String firstuser = null;
    String nextuser = null;
    batch_mutation_t rmInbox = 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;
      int uid =0;
      String user = null;
      while (st.hasMoreElements()) {
        switch (i) {
        case 0:
          user = (String) st.nextElement();// sb.append((String)st.nextElement());
                    if ( !isNumeric(user))
                        continue;
         
          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;
      }

      nextuser = user;
      if (firstuser == null || firstuser.compareTo(nextuser) != 0) {
        firstuser = nextuser;
        if (rmInbox != null && !rmInbox.cfmap.isEmpty()) {
          apply(rmInbox);
        }
        rmInbox = new batch_mutation_t();
        rmInbox.table = "Mailbox";
        rmInbox.key = firstuser;
        rmInbox.cfmap = new HashMap<String, List<column_t>>();
      }
      column_t columnData = new column_t();
View Full Code Here

Examples of org.apache.cassandra.service.batch_mutation_t

        new FileInputStream(filepath)), 16 * 1024 * 1024);
    String line = null;
    String delimiter_ = new String(",");
    String firstuser = null;
    String nextuser = null;
    batch_mutation_t rmInbox = null;
    batch_mutation_t rmOutbox = null;
    while ((line = bufReader.readLine()) != null) {
      StringTokenizer st = new StringTokenizer(line, delimiter_);
      int i = 0;
      String threadId = null;
      int lastUpdated = 0;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.