当前位置: 首页>>代码示例>>Java>>正文


Java Column.getName方法代码示例

本文整理汇总了Java中org.apache.cassandra.thrift.Column.getName方法的典型用法代码示例。如果您正苦于以下问题:Java Column.getName方法的具体用法?Java Column.getName怎么用?Java Column.getName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.cassandra.thrift.Column的用法示例。


在下文中一共展示了Column.getName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: QueryOneMinute

import org.apache.cassandra.thrift.Column; //导入方法依赖的package包/类
public List<String> QueryOneMinute(String min) {
	List<String> userList = new ArrayList<String>();
	try {
		List<ColumnOrSuperColumn> results = client.get_slice(Utils
				.toByteBuffer(min), columnParent, predicate,
				ConsistencyLevel.ONE);
		for (ColumnOrSuperColumn cc : results) {
			SuperColumn superColumn = cc.getSuper_column();
			List<Column> list = superColumn.getColumns();
			for (Column c : list) {
				String columnName = new String(c.getName(), "UTF-8");
				if (columnName.equals("username")) {
					String value = new String(c.getValue(), "UTF-8");
					if (!userList.contains(value)) {
						userList.add(value);
					}
				}
			}
		}
	} catch (Exception e) {
		System.out.println(e);
	}
	return userList;
}
 
开发者ID:YinYanfei,项目名称:CadalWorkspace,代码行数:25,代码来源:CasTimeReader.java

示例2: QueryOneMinute

import org.apache.cassandra.thrift.Column; //导入方法依赖的package包/类
public List<String> QueryOneMinute(String min){
	List<String> bookList = new ArrayList<String>();
	try {
		List<ColumnOrSuperColumn> results = client.get_slice(Utils
				.toByteBuffer(min), columnParent, predicate,
				ConsistencyLevel.ONE);
		for (ColumnOrSuperColumn cc : results) {
			SuperColumn superColumn = cc.getSuper_column();
			List<Column> list = superColumn.getColumns();
			for (Column c : list) {
				String columnName = new String(c.getName(), "UTF-8");
				if (columnName.equals("bookno")) {
					String value = new String(c.getValue(), "UTF-8");
					if (!bookList.contains(value)) {
						bookList.add(value);
					}
				}
			}
		}
	} catch (Exception e) {
		System.out.println(e);
	}
	return bookList;
}
 
开发者ID:YinYanfei,项目名称:CadalWorkspace,代码行数:25,代码来源:CasTimeBook.java

示例3: convertKeySliceList

import org.apache.cassandra.thrift.Column; //导入方法依赖的package包/类
private List<Map<String,Object>> convertKeySliceList(List<KeySlice> keySliceList, String primaryKeyName) {
    List<Map<String,Object>> rowList = new ArrayList<Map<String,Object>>();
    try {
        for (KeySlice keySlice: keySliceList) {
            List<ColumnOrSuperColumn> columnList = keySlice.getColumns();
            if (!columnList.isEmpty()) {
                byte[] keyBytes = keySlice.getKey();
                String key = new String(keyBytes, "UTF-8");
                Map<String,Object> columnMap = new HashMap<String,Object>();
                columnMap.put(primaryKeyName, key);
                for (ColumnOrSuperColumn columnOrSuperColumn: columnList) {
                    Column column = columnOrSuperColumn.getColumn();
                    byte[] columnNameBytes = column.getName();
                    String columnName = new String(columnNameBytes, "UTF-8");
                    byte[] valueBytes = column.getValue();
                    String value = new String(valueBytes, "UTF-8");
                    if (value.equals(NULL_VALUE_STRING))
                        value = null;
                    columnMap.put(columnName, value);
                }
                rowList.add(columnMap);
            }
        }
        return rowList;
    }
    catch (UnsupportedEncodingException exc) {
        throw new StorageException("Character encoding exception with key range", exc);
    }
}
 
开发者ID:opendaylight,项目名称:archived-net-virt-platform,代码行数:30,代码来源:Connection.java

示例4: QueryIpUser

import org.apache.cassandra.thrift.Column; //导入方法依赖的package包/类
/**
 * Query and Check item is exist or not
 * 
 * return times of item
 */
public int QueryIpUser(String ip, String name){
	String IP_KEY = ip;
	String NAME_SUPER_KEY = name;
	String COLUMN_NAME = "times";
	String COLUMN_FAMILY = "IpUser";
	
	try{
		ColumnPath columnPath = new ColumnPath();
		columnPath.column_family = COLUMN_FAMILY;
		columnPath.super_column = this.cassandraUtil.toByteBuffer(NAME_SUPER_KEY);
		
		ColumnOrSuperColumn columnOrSuperColumn = client.get(this.cassandraUtil.toByteBuffer(IP_KEY), columnPath, ConsistencyLevel.ONE);

		SuperColumn superColumn = columnOrSuperColumn.getSuper_column();
		
		List<Column> columns = superColumn.getColumns();
		
		for(Column col : columns) {
			String title = new String(col.getName(), "UTF-8") ;
			
			if(title.equals(COLUMN_NAME)){
				return Integer.parseInt(new String(col.getValue(), "UTF-8"));     // get "times" column and return 
			}
		}
	}catch(Exception e){
		return 0;
	}

	return 0;
}
 
开发者ID:YinYanfei,项目名称:CadalWorkspace,代码行数:36,代码来源:CassandraQuery.java

示例5: QueryUserIp

import org.apache.cassandra.thrift.Column; //导入方法依赖的package包/类
/**
 * Query and Check item is exist or not
 * 
 * return times of item
 */
public int QueryUserIp(String ip, String name){
	String NAME_KEY = name;
	String IP_SUPER_KEY = ip;
	String COLUMN_NAME = "times";
	String COLUMN_FAMILY = "UserIp";
	
	try{
		ColumnPath columnPath = new ColumnPath();
		columnPath.column_family = COLUMN_FAMILY;
		columnPath.super_column = this.cassandraUtil.toByteBuffer(IP_SUPER_KEY);
		
		ColumnOrSuperColumn columnOrSuperColumn = client.get(this.cassandraUtil.toByteBuffer(NAME_KEY), columnPath, ConsistencyLevel.ONE);

		SuperColumn superColumn = columnOrSuperColumn.getSuper_column();
		
		List<Column> columns = superColumn.getColumns();
		
		for(Column col : columns) {
			String title = new String(col.getName(), "UTF-8") ;
			if(title.equals(COLUMN_NAME)){
				return Integer.parseInt(new String(col.getValue(), "UTF-8"));     // get "times" column and return 
			}
		}
	}catch(Exception e){
		return 0;
	}
	
	return 0;
}
 
开发者ID:YinYanfei,项目名称:CadalWorkspace,代码行数:35,代码来源:CassandraQuery.java

示例6: QueryBookIp

import org.apache.cassandra.thrift.Column; //导入方法依赖的package包/类
/**
 * Query and Check BookIp
 * 
 * return times of column is exist, 0 or not
 */
public int QueryBookIp(String bookid, String ip) {
	String BOOKID_KEY = bookid;
	String IP_SUPER_KEY = ip;
	String COLUMN_NAME = "times";
	String COLUMN_FAMILY = "BookIp";

	try {
		ColumnPath columnPath = new ColumnPath();
		columnPath.column_family = COLUMN_FAMILY;
		columnPath.super_column = this.cassandraUtil.toByteBuffer(IP_SUPER_KEY);

		ColumnOrSuperColumn columnOrSuperColumn = client.get(this.cassandraUtil.toByteBuffer(BOOKID_KEY), columnPath,ConsistencyLevel.ONE);

		SuperColumn superColumn = columnOrSuperColumn.getSuper_column();

		List<Column> columns = superColumn.getColumns();


		for (Column col : columns) {
			String title = new String(col.getName(), "UTF-8");
			if (title.equals(COLUMN_NAME)) {
				return Integer.parseInt(new String(col.getValue(), "UTF-8"));
			}
		}

	} catch (Exception e) {
		return 0;
	}

	return 0;
}
 
开发者ID:YinYanfei,项目名称:CadalWorkspace,代码行数:37,代码来源:CassandraQuery.java

示例7: QueryBookUser

import org.apache.cassandra.thrift.Column; //导入方法依赖的package包/类
/**
 * Query and Check BookUser
 * 
 * return times of column is exist, 0 or not
 */
public int QueryBookUser(String bookid, String user) {
	String BOOKID_KEY = bookid;
	String USER_SUPER_KEY = user;
	String COLUMN_NAME = "times";
	String COLUMN_FAMILY = "BookUser";
	
	try{
		ColumnPath columnPath = new ColumnPath();
		columnPath.column_family = COLUMN_FAMILY;
		columnPath.super_column = this.cassandraUtil.toByteBuffer(USER_SUPER_KEY);
		
		ColumnOrSuperColumn columnOrSuperColumn = client.get(this.cassandraUtil.toByteBuffer(BOOKID_KEY), columnPath, ConsistencyLevel.ONE);
		
		SuperColumn superColumn = columnOrSuperColumn.getSuper_column();
		
		List<Column> columns = superColumn.getColumns();
		
		for(Column col : columns) {
			String title = new String(col.getName(), "UTF-8");
			if(title.equals(COLUMN_NAME)) {
				return Integer.parseInt(new String(col.getValue(), "UTF-8"));
			}
		}
		
	}catch(Exception e) {
		return 0;
	}
	
	return 0;
}
 
开发者ID:YinYanfei,项目名称:CadalWorkspace,代码行数:36,代码来源:CassandraQuery.java

示例8: QueryIpBookPage

import org.apache.cassandra.thrift.Column; //导入方法依赖的package包/类
/**
 * Query and Check IpBookPage
 * 
 * return times of column is exist, 0 or not
 */
public int QueryIpBookPage(String ip, String book) {
	String IP_KEY = ip;
	String BOOKID_SUPER_KEY = book;
	String COLUMN_FAMILY = "IpBookPage";
	String COLUMN_NAME = "times";
	
	try{
		ColumnPath columnPath = new ColumnPath();
		columnPath.column_family = COLUMN_FAMILY;
		columnPath.super_column = this.cassandraUtil.toByteBuffer(BOOKID_SUPER_KEY);
		
		ColumnOrSuperColumn columnOrSuperColumn = client.get(this.cassandraUtil.toByteBuffer(IP_KEY), columnPath, ConsistencyLevel.ONE);
		
		SuperColumn superColumn = columnOrSuperColumn.getSuper_column();
		
		List<Column> columns = superColumn.getColumns();
		
		for(Column col : columns) {
			String title = new String(col.getName(), "UTF-8");
			if(title.equals(COLUMN_NAME)) {
				return Integer.parseInt(new String(col.getValue(), "UTF-8"));
			}
		}
		
	}catch(Exception e){
		return 0;
	}
	
	return 0;
}
 
开发者ID:YinYanfei,项目名称:CadalWorkspace,代码行数:36,代码来源:CassandraQuery.java

示例9: QueryUserBookPage

import org.apache.cassandra.thrift.Column; //导入方法依赖的package包/类
/**
 * Query and Check UserBookPage
 * 
 * return times of column is exist, 0 or not
 */
public int QueryUserBookPage(String user, String book) {
	String USER_KEY = user;
	String BOOK_SUPER_KEY = book;
	String COLUMN_FAMILY = "UserBookPage";
	String COLUMN_NAME = "times";
	
	try{
		ColumnPath columnPath = new ColumnPath();
		columnPath.column_family = COLUMN_FAMILY;
		columnPath.super_column = this.cassandraUtil.toByteBuffer(BOOK_SUPER_KEY);
		
		ColumnOrSuperColumn columnOrSuperColumn = client.get(this.cassandraUtil.toByteBuffer(USER_KEY), columnPath, ConsistencyLevel.ONE);
		
		SuperColumn superColumn = columnOrSuperColumn.getSuper_column();
		
		List<Column> columns = superColumn.getColumns();
		
		for(Column col : columns) {
			String title = new String(col.getName(), "UTF-8");
			if(title.equals(COLUMN_NAME)) {
				return Integer.parseInt(new String(col.getValue(), "UTF-8"));
			}
		}
		
	}catch(Exception e) {
		return 0;
	}
	
	return 0;
}
 
开发者ID:YinYanfei,项目名称:CadalWorkspace,代码行数:36,代码来源:CassandraQuery.java

示例10: QueryFromBCPRelation

import org.apache.cassandra.thrift.Column; //导入方法依赖的package包/类
/**
 * To query from 'BCPRelation'
 * @param bookChapterList
 */
public void QueryFromBCPRelation (List<List<String>> bookChapterList){		
	SlicePredicate predicate = new SlicePredicate();
	SliceRange range = new SliceRange();
	
	range.setStart(new byte[0]);
	range.setFinish(new byte[0]); 
	
	predicate.setSlice_range(range);
	
	ColumnParent parent = new ColumnParent();
	parent.column_family = "BCPRelation";

	try{
		for (int i = 0; i < bookChapterList.size(); ++i) {
			List<String> innerResult = new ArrayList<String>();
			
			List<String> innerList = bookChapterList.get(i);
			
			// Deal with a single book info list
			String bookId = innerList.get(0);
			List<String> chapterList = innerList.subList(1, innerList.size());
			
			innerResult.add(bookId);
			
			// Query from cassandra
			List<ColumnOrSuperColumn> results = client.get_slice(this.cassandraUtil.toByteBuffer(bookId), parent, predicate,ConsistencyLevel.ONE);
			
			// Iterator SuperColumn List
			for (ColumnOrSuperColumn result : results) {
				SuperColumn superColumn2 = result.super_column;
				List<Column> columns2 = superColumn2.getColumns();

				// Get detail information of a single chapter
				String chapterLevel = "";
				String chapterTitle = "";
				
				for (Column column : columns2) {
					String columnName = new String(column.getName(), "UTF-8");
					
					if (columnName.equalsIgnoreCase("ChapterLevel")) {
						chapterLevel = new String(column.getValue(), "UTF-8");
					} else if (columnName.equalsIgnoreCase("ChapterLabel")) {
						chapterTitle = new String(column.getValue(), "UTF-8");
					}
				}
				
				// Iterator chapterList insert into map
				for(int j = 0; j < chapterList.size(); ++j){
					if(chapterLevel.equals(chapterList.get(j))) {
						innerResult.add(chapterTitle);
					}
				}
			}
			
			this.finalResult.add(innerResult);
		}

	}catch(Exception e) {
		LOG.warn("Error when dealing bookChapterList");
		e.printStackTrace();
	}
}
 
开发者ID:YinYanfei,项目名称:CadalWorkspace,代码行数:67,代码来源:QueryBCPRelation.java

示例11: QueryRecordMinute

import org.apache.cassandra.thrift.Column; //导入方法依赖的package包/类
public void QueryRecordMinute(String queryWord) {
	TTransport tr = new TFramedTransport(new TSocket("10.15.61.111", 9160));
	TProtocol proto = new TBinaryProtocol(tr);
	Cassandra.Client client = new Cassandra.Client(proto);

	try {
		tr.open();
		client.set_keyspace("CadalSecTest");
	
		// read entire row
		//System.out.println("------------Entire---------------");
		SlicePredicate predicate = new SlicePredicate();//null, new SliceRange(new byte[0], new byte[0], false, 10)
		SliceRange range = new SliceRange();
		range.start = toByteBuffer("");
		range.finish = toByteBuffer("");
		predicate.setSlice_range(range);
		
		ColumnParent parent = new ColumnParent();
		parent.column_family = "RecordMinute";
		
		String username = "";
		String bookno   = "";
		List<ColumnOrSuperColumn> results = client.get_slice(toByteBuffer(queryWord), parent, predicate, ConsistencyLevel.ONE);
		for (ColumnOrSuperColumn result : results) {
			SuperColumn superColumn2 = result.super_column;
			List<Column> columns2 = superColumn2.getColumns();
			
			// To get map<username, list[bookno]>
			for (Column column : columns2) {
				//System.out.println(new String(column.getName(), "UTF-8") + " -> "+ new String(column.getValue(), "UTF-8"));
				
				String columnName = new String(column.getName(), "UTF-8");
				
				if(columnName.equals("username")) {	
					username  = new String(column.getValue(), "UTF-8");	
				}else if(columnName.equals("bookno")) {
					bookno = new String(column.getValue(), "UTF-8");
				}
			}
			
			if(this.MapUserBook.containsKey(username)) {
				if(!this.MapUserBook.get(username).contains(bookno)) {
					this.MapUserBook.get(username).add(bookno);
				}
			}else{
				ArrayList<String> bookList = new ArrayList<String>();
				bookList.add(bookno);
				this.MapUserBook.put(username, bookList);
			}
			
			//System.out.println("-------------------------------------------------");
		}
		
		tr.close();
	} catch (Exception e) {
		e.printStackTrace();
	}
}
 
开发者ID:YinYanfei,项目名称:CadalWorkspace,代码行数:59,代码来源:CassandraOp.java

示例12: GetChapterLevel

import org.apache.cassandra.thrift.Column; //导入方法依赖的package包/类
/**
 * This function is used to deal many pages of a book, to find all chapter_level info of pages.
 * @param bookNo like: 07018720
 * @param pageNoList just like: <<23>, <45>, <2>>
 * @return List of book_page:<<07018720_1.1.0.0.0>, <07018720_2.0.0.0.0>, <07018720_1.2.0.0.0>>
 */
@SuppressWarnings("unchecked")
public List<String> GetChapterLevel(String bookNo, List<Integer> pageNoList){
	
	SlicePredicate predicate = new SlicePredicate();
	SliceRange range = new SliceRange();
	
	range.setStart(new byte[0]);
	range.setFinish(new byte[0]); 
	
	predicate.setSlice_range(range);

	ColumnParent parent = new ColumnParent();
	parent.column_family = "BCPRelation";

	Map<String, String> tmpMap = new HashMap<String, String>();
	List<String> returnStrList = new ArrayList<String>();
		
	try {
		List<ColumnOrSuperColumn> results = client.get_slice(this.cassandraUtil.toByteBuffer(bookNo), parent, predicate,ConsistencyLevel.ONE);

		// Iterator SuperColumn List
		for (ColumnOrSuperColumn result : results) {
			SuperColumn superColumn2 = result.super_column;
			List<Column> columns2 = superColumn2.getColumns();

			// Get detail information of a single chapter
			int startPage = 0;
			int endPage = 0;
			String chapterLevel = "";
			
			for (Column column : columns2) {
				String columnName = new String(column.getName(), "UTF-8");
				
				if (columnName.equalsIgnoreCase("ChapterLevel")) {
					chapterLevel = new String(column.getValue(), "UTF-8");
				} else if (columnName.equalsIgnoreCase("StartPage")) {
					startPage = Integer.valueOf(new String(column.getValue(), "UTF-8")).intValue();
				} else if (columnName.equalsIgnoreCase("EndPage")) {
					endPage = Integer.valueOf(new String(column.getValue(), "UTF-8")).intValue();
				} 
			}
			
			// Iterator PageNoList insert into map
			for(int j = 0; j < pageNoList.size(); ++j){
				if(MatchRange(pageNoList.get(j), startPage, endPage)) {
					tmpMap.put(bookNo + "_" + chapterLevel, "");
				}
			}

		}
		
		// Convert Map to List
		Iterator iter = tmpMap.entrySet().iterator(); 
		while (iter.hasNext()) { 
		    Map.Entry entry = (Map.Entry)iter.next(); 
		    Object key = entry.getKey(); 
		    
		    returnStrList.add(key.toString());			    
		}
		
		return returnStrList;
		
	} catch (Exception e) {
		 e.printStackTrace();
	}
	
	return returnStrList;
}
 
开发者ID:YinYanfei,项目名称:CadalWorkspace,代码行数:75,代码来源:ChapterLevel.java

示例13: GetAllInfoOfUser

import org.apache.cassandra.thrift.Column; //导入方法依赖的package包/类
/**
 * To get all book-page information about an allocated 'username'
 * @param String username: like 'zju' 'Yanfei'
 */
public Map<String, List<String>> GetAllInfoOfUser(String username) {
	
	Map<String, List<String>> infoMap = new HashMap<String, List<String>>();
	
	SlicePredicate predicate = new SlicePredicate();// null, new
	SliceRange range = new SliceRange();
	
	range.setStart(new byte[0]);
	range.setFinish(new byte[0]); 
	range.setCount(200000);
	
	predicate.setSlice_range(range);

	ColumnParent parent = new ColumnParent();
	parent.column_family = "UserBookPage";

	String bookid;
	List<String> listPage = null;
	
	try {
		List<ColumnOrSuperColumn> results = client.get_slice(this.cassandraUtil.toByteBuffer(username), parent, predicate, ConsistencyLevel.ONE);
		
		for (ColumnOrSuperColumn result : results) {
			listPage = new ArrayList<String>();
			
			SuperColumn superColumn2 = result.super_column;
			
			bookid = "";
			bookid = new String(superColumn2.getName(), "UTF-8");           // bookid
			
			List<Column> columns2 = superColumn2.getColumns();
			
			for (Column column : columns2) {
				String columnName = new String(column.getName(), "UTF-8");
				
				if(columnName.equalsIgnoreCase("times")){
					continue;
				}else{
					listPage.add(new String(column.getName(), "UTF-8"));     // page-number
				}
			}
			
			infoMap.put(bookid, listPage);
		}
		
		return infoMap;
	} catch (Exception e) {
		 e.printStackTrace();
		 return infoMap;
	}

}
 
开发者ID:YinYanfei,项目名称:CadalWorkspace,代码行数:57,代码来源:UserBookPageInfo.java

示例14: QueryFromBCPRelation

import org.apache.cassandra.thrift.Column; //导入方法依赖的package包/类
/**
 * To query from 'BCPRelation'
 * @param bookChapterList
 * @return
 */
@SuppressWarnings("unchecked")
public List<String> QueryFromBCPRelation (List<String> bookChapterList){
	List<String> chapterList = new ArrayList<String>();
	
	SlicePredicate predicate = new SlicePredicate();
	SliceRange range = new SliceRange();
	
	range.setStart(new byte[0]);
	range.setFinish(new byte[0]); 
	
	predicate.setSlice_range(range);
	
	ColumnParent parent = new ColumnParent();
	parent.column_family = "BCPRelation";

	try{
		Map<String, List<String>> mapBookChapter = this.Preprocess(bookChapterList);

		for (Iterator iter = mapBookChapter.keySet().iterator(); iter.hasNext();) {  
		    Object key = iter.next();
		    Object val = mapBookChapter.get(key);
		    
		    List<ColumnOrSuperColumn> results = client.get_slice(this.cassandraUtil.toByteBuffer(key.toString()), parent, predicate,ConsistencyLevel.ONE);
		    
			// Iterator SuperColumn List
			for (ColumnOrSuperColumn result : results) {
				SuperColumn superColumn2 = result.super_column;
				List<Column> columns2 = superColumn2.getColumns();

				// Get detail information of a single chapter
				String chapterLevel = "";
				String chapterTitle = "";
				
				for (Column column : columns2) {
					String columnName = new String(column.getName(), "UTF-8");
					
					if (columnName.equalsIgnoreCase("ChapterLevel")) {
						chapterLevel = new String(column.getValue(), "UTF-8");
					} else if (columnName.equalsIgnoreCase("ChapterLabel")) {
						chapterTitle = new String(column.getValue(), "UTF-8");
					}
				}
				
				// Iterator PageNoList insert into map
				List<String> listStr = (List<String>) val;
				for(int j = 0; j < listStr.size(); ++j){
					if(chapterLevel.equals(listStr.get(j))) {
						chapterList.add(chapterTitle);
					}
				}
			}
		}  
		
		return chapterList;
	}catch(Exception e) {
		LOG.warn("Error when dealing bookChapterList");
		e.printStackTrace();
	}
	
	return chapterList;
}
 
开发者ID:YinYanfei,项目名称:CadalWorkspace,代码行数:67,代码来源:QueryBCPRelation.java

示例15: getChapterInfo

import org.apache.cassandra.thrift.Column; //导入方法依赖的package包/类
public void getChapterInfo() {
			SlicePredicate predicate = new SlicePredicate();// null, new
			SliceRange range = new SliceRange();
			
			range.setStart(new byte[0]);
			range.setFinish(new byte[0]); 
			
			predicate.setSlice_range(range);

			ColumnParent parent = new ColumnParent();
			parent.column_family = "BCPRelation";

			try {
				List<ColumnOrSuperColumn> results = client.get_slice(toByteBuffer(bookNo), parent, predicate,ConsistencyLevel.ONE);

				for (ColumnOrSuperColumn result : results) {
					SuperColumn superColumn2 = result.super_column;
					
					System.out.println(new String(superColumn2.getName(), "UTF-8"));
					
					List<Column> columns2 = superColumn2.getColumns();

					String chapterName = null;
					int startPage = 0;
					int endPage = 0;
					String chapterLevel = "";
					
					for (Column column : columns2) {
						String columnName = new String(column.getName(), "UTF-8");
												
						if (columnName.equalsIgnoreCase("ChapterLevel")) {
							chapterLevel = new String(column.getValue(), "UTF-8");
						} else if (columnName.equalsIgnoreCase("StartPage")) {
							startPage = Integer.parseInt(new String(column.getValue(), "UTF-8"));
						} else if (columnName.equalsIgnoreCase("EndPage")) {
							endPage = Integer.parseInt(new String(column.getValue(), "UTF-8"));
						} else if (columnName.equalsIgnoreCase("ChapterLabel")) {
							chapterName = new String(column.getValue(), "UTF-8");
						}
					}
					
					if (MatchRange(pageNo, startPage, endPage)) { 
						   System.out.println("BookNo:" + bookNo + "   PageNo:" + pageNo + "  in[" + chapterName + "]:" 
								   + " StartPage:" + startPage + "  EndPage:" + endPage);
						   System.out.println(chapterLevel);
					}
				}
			} catch (Exception e) {
				 e.printStackTrace();
			}

//			tr.close();
		}
 
开发者ID:YinYanfei,项目名称:CadalWorkspace,代码行数:54,代码来源:PageChapterMatch.java


注:本文中的org.apache.cassandra.thrift.Column.getName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。