• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java TScan类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.hadoop.hbase.thrift.generated.TScan的典型用法代码示例。如果您正苦于以下问题:Java TScan类的具体用法?Java TScan怎么用?Java TScan使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



TScan类属于org.apache.hadoop.hbase.thrift.generated包,在下文中一共展示了TScan类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: scannerOpenWithScan

import org.apache.hadoop.hbase.thrift.generated.TScan; //导入依赖的package包/类
public int scannerOpenWithScan(ByteBuffer tableName, TScan tScan,
    Map<ByteBuffer, ByteBuffer> attributes)
    throws IOError {
  try {
    HTable table = getTable(tableName);
    Scan scan = new Scan();
    addAttributes(scan, attributes);
    if (tScan.isSetStartRow()) {
      scan.setStartRow(tScan.getStartRow());
    }
    if (tScan.isSetStopRow()) {
      scan.setStopRow(tScan.getStopRow());
    }
    if (tScan.isSetTimestamp()) {
      scan.setTimeRange(Long.MIN_VALUE, tScan.getTimestamp());
    }
    if (tScan.isSetCaching()) {
      scan.setCaching(tScan.getCaching());
    }
    if (tScan.isSetColumns() && tScan.getColumns().size() != 0) {
      for(ByteBuffer column : tScan.getColumns()) {
        byte [][] famQf = KeyValue.parseColumn(getBytes(column));
        if(famQf.length == 1) {
          scan.addFamily(famQf[0]);
        } else {
          scan.addColumn(famQf[0], famQf[1]);
        }
      }
    }
    if (tScan.isSetFilterString()) {
      ParseFilter parseFilter = new ParseFilter();
      scan.setFilter(
          parseFilter.parseFilterString(tScan.getFilterString()));
    }
    return addScanner(table.getScanner(scan), tScan.sortColumns);
  } catch (IOException e) {
    LOG.warn(e.getMessage(), e);
    throw new IOError(e.getMessage());
  }
}
 
开发者ID:fengchen8086,项目名称:LCIndex-HBase-0.94.16,代码行数:41,代码来源:ThriftServerRunner.java


示例2: rowFilter

import org.apache.hadoop.hbase.thrift.generated.TScan; //导入依赖的package包/类
@Test
public void rowFilter() throws Exception {
	String TABLE_NAME = "UIH_OverallItemInfo";

	List<TRowResult> results = null;
	//
	List<ByteBuffer> columns = new LinkedList<ByteBuffer>();
	Map<ByteBuffer, ByteBuffer> attributes = new HashMap<ByteBuffer, ByteBuffer>();
	//
	TScan scan = new TScan();
	scan.setCaching(200);
	//
	String filterString = "RowFilter(=, 'regexstring:00[1-3]00')";
	scan.setFilterString(ByteBufferHelper.toByteBuffer(filterString));
	scan.setColumns(columns);
	//
	int scannerId = 0;
	long beg = System.currentTimeMillis();
	try {
		scannerId = client.scannerOpenWithScan(
				ByteBufferHelper.toByteBuffer(TABLE_NAME), scan, attributes);// 可以attributes=null
		results = client.scannerGetList(scannerId, 10);// 讀取幾筆
	} catch (Exception ex) {
		ex.printStackTrace();
	} finally {
		if (scannerId >= 0) {
			client.scannerClose(scannerId);// 一定要關閉
		}
	}
	long end = System.currentTimeMillis();
	System.out.println((end - beg) + " at mills.");
	printlnResult(results);
}
 
开发者ID:mixaceh,项目名称:openyu-commons,代码行数:34,代码来源:HBaseThriftDMLTest.java


示例3: prefixFilter

import org.apache.hadoop.hbase.thrift.generated.TScan; //导入依赖的package包/类
@Test
public void prefixFilter() throws Exception {
	String TABLE_NAME = "UIH_OverallItemInfo";

	List<TRowResult> results = null;
	//
	List<ByteBuffer> columns = new LinkedList<ByteBuffer>();
	Map<ByteBuffer, ByteBuffer> attributes = new HashMap<ByteBuffer, ByteBuffer>();
	//
	TScan scan = new TScan();
	scan.setCaching(200);
	//
	String filterString = "PrefixFilter('1000|B101|A17P')";
	scan.setFilterString(ByteBufferHelper.toByteBuffer(filterString));
	scan.setColumns(columns);
	//
	int scannerId = 0;
	long beg = System.currentTimeMillis();
	try {
		scannerId = client.scannerOpenWithScan(
				ByteBufferHelper.toByteBuffer(TABLE_NAME), scan, attributes);// 可以attributes=null
		results = client.scannerGetList(scannerId, 10);// 讀取幾筆
	} catch (Exception ex) {
		ex.printStackTrace();
	} finally {
		if (scannerId >= 0) {
			client.scannerClose(scannerId);// 一定要關閉
		}
	}
	long end = System.currentTimeMillis();
	System.out.println((end - beg) + " at mills.");
	printlnResult(results);
}
 
开发者ID:mixaceh,项目名称:openyu-commons,代码行数:34,代码来源:HBaseThriftDMLTest.java


示例4: keyOnlyFilter

import org.apache.hadoop.hbase.thrift.generated.TScan; //导入依赖的package包/类
/**
 * 只傳回key值,value屏蔽掉
 *
 * @throws Exception
 */
@Test
public void keyOnlyFilter() throws Exception {
	String TABLE_NAME = "UIH_OverallItemInfo";
	List<TRowResult> results = null;
	//
	List<ByteBuffer> columns = new LinkedList<ByteBuffer>();
	Map<ByteBuffer, ByteBuffer> attributes = new HashMap<ByteBuffer, ByteBuffer>();
	//
	TScan scan = new TScan();
	scan.setCaching(200);
	// KeyOnlyFilter()

	String filterString = "KeyOnlyFilter()";
	scan.setFilterString(ByteBufferHelper.toByteBuffer(filterString));
	scan.setColumns(columns);
	//
	int scannerId = 0;
	long beg = System.currentTimeMillis();
	try {
		scannerId = client.scannerOpenWithScan(
				ByteBufferHelper.toByteBuffer(TABLE_NAME), scan, attributes);// 可以attributes=null
		results = client.scannerGetList(scannerId, 10);// 讀取幾筆
	} catch (Exception ex) {
		ex.printStackTrace();
	} finally {
		if (scannerId >= 0) {
			client.scannerClose(scannerId);// 一定要關閉
		}
	}
	long end = System.currentTimeMillis();
	System.out.println((end - beg) + " at mills.");
	//
	printlnResult(results);
}
 
开发者ID:mixaceh,项目名称:openyu-commons,代码行数:40,代码来源:HBaseThriftDMLTest.java


示例5: firstKeyOnlyFilter

import org.apache.hadoop.hbase.thrift.generated.TScan; //导入依赖的package包/类
/**
 * 只傳回第一個keyValue
 *
 * @throws Exception
 */
@Test
public void firstKeyOnlyFilter() throws Exception {
	String TABLE_NAME = "UIH_OverallItemInfo";
	List<TRowResult> results = null;
	//
	List<ByteBuffer> columns = new LinkedList<ByteBuffer>();
	Map<ByteBuffer, ByteBuffer> attributes = new HashMap<ByteBuffer, ByteBuffer>();
	//
	TScan scan = new TScan();
	scan.setCaching(200);
	// FirstKeyOnlyFilter()

	String filterString = "FirstKeyOnlyFilter()";
	scan.setFilterString(ByteBufferHelper.toByteBuffer(filterString));
	scan.setColumns(columns);
	//
	int scannerId = 0;
	long beg = System.currentTimeMillis();
	try {
		scannerId = client.scannerOpenWithScan(
				ByteBufferHelper.toByteBuffer(TABLE_NAME), scan, attributes);// 可以attributes=null
		results = client.scannerGetList(scannerId, 10);// 讀取幾筆
	} catch (Exception ex) {
		ex.printStackTrace();
	} finally {
		if (scannerId >= 0) {
			client.scannerClose(scannerId);// 一定要關閉
		}
	}
	long end = System.currentTimeMillis();
	System.out.println((end - beg) + " at mills.");
	//
	printlnResult(results);
}
 
开发者ID:mixaceh,项目名称:openyu-commons,代码行数:40,代码来源:HBaseThriftDMLTest.java


示例6: scannerOpenWithScan

import org.apache.hadoop.hbase.thrift.generated.TScan; //导入依赖的package包/类
public int scannerOpenWithScan(ByteBuffer tableName, TScan tScan) throws IOError {
    try {
      HTable table = getTable(tableName);
      Scan scan = new Scan();
      if (tScan.isSetStartRow()) {
          scan.setStartRow(tScan.getStartRow());
      }
      if (tScan.isSetStopRow()) {
          scan.setStopRow(tScan.getStopRow());
      }
      if (tScan.isSetTimestamp()) {
          scan.setTimeRange(Long.MIN_VALUE, tScan.getTimestamp());              
      }
      if (tScan.isSetCaching()) {
          scan.setCaching(tScan.getCaching());
      }
      if(tScan.isSetColumns() && tScan.getColumns().size() != 0) {
        for(ByteBuffer column : tScan.getColumns()) {
          byte [][] famQf = KeyValue.parseColumn(getBytes(column));
          if(famQf.length == 1) {
            scan.addFamily(famQf[0]);
          } else {
            scan.addColumn(famQf[0], famQf[1]);
          }
        }
      }
      if (tScan.isSetFilterString()) {
        ParseFilter parseFilter = new ParseFilter();
        scan.setFilter(parseFilter.parseFilterString(tScan.getFilterString()));
      }
      return addScanner(table.getScanner(scan));
    } catch (IOException e) {
      throw new IOError(e.getMessage());
    }
}
 
开发者ID:lifeng5042,项目名称:RStore,代码行数:36,代码来源:ThriftServer.java


示例7: scannerOpenWithScan

import org.apache.hadoop.hbase.thrift.generated.TScan; //导入依赖的package包/类
public int scannerOpenWithScan(ByteBuffer tableName, TScan tScan,
    Map<ByteBuffer, ByteBuffer> attributes)
    throws IOError {
  try {
    HTable table = getTable(tableName);
    Scan scan = new Scan();
    addAttributes(scan, attributes);
    if (tScan.isSetStartRow()) {
      scan.setStartRow(tScan.getStartRow());
    }
    if (tScan.isSetStopRow()) {
      scan.setStopRow(tScan.getStopRow());
    }
    if (tScan.isSetTimestamp()) {
      scan.setTimeRange(Long.MIN_VALUE, tScan.getTimestamp());
    }
    if (tScan.isSetCaching()) {
      scan.setCaching(tScan.getCaching());
    }
    if (tScan.isSetColumns() && tScan.getColumns().size() != 0) {
      for(ByteBuffer column : tScan.getColumns()) {
        byte [][] famQf = KeyValue.parseColumn(getBytes(column));
        if(famQf.length == 1) {
          scan.addFamily(famQf[0]);
        } else {
          scan.addColumn(famQf[0], famQf[1]);
        }
      }
    }
    if (tScan.isSetFilterString()) {
      ParseFilter parseFilter = new ParseFilter();
      scan.setFilter(
          parseFilter.parseFilterString(tScan.getFilterString()));
    }
    return addScanner(table.getScanner(scan));
  } catch (IOException e) {
    LOG.warn(e.getMessage(), e);
    throw new IOError(e.getMessage());
  }
}
 
开发者ID:zwqjsj0404,项目名称:HBase-Research,代码行数:41,代码来源:ThriftServerRunner.java


示例8: scannerOpenWithScan

import org.apache.hadoop.hbase.thrift.generated.TScan; //导入依赖的package包/类
@Override
public int scannerOpenWithScan(ByteBuffer tableName, TScan tScan,
    Map<ByteBuffer, ByteBuffer> attributes)
    throws IOError {

  Table table = null;
  try {
    table = getTable(tableName);
    Scan scan = new Scan();
    addAttributes(scan, attributes);
    if (tScan.isSetStartRow()) {
      scan.setStartRow(tScan.getStartRow());
    }
    if (tScan.isSetStopRow()) {
      scan.setStopRow(tScan.getStopRow());
    }
    if (tScan.isSetTimestamp()) {
      scan.setTimeRange(0, tScan.getTimestamp());
    }
    if (tScan.isSetCaching()) {
      scan.setCaching(tScan.getCaching());
    }
    if (tScan.isSetBatchSize()) {
      scan.setBatch(tScan.getBatchSize());
    }
    if (tScan.isSetColumns() && tScan.getColumns().size() != 0) {
      for(ByteBuffer column : tScan.getColumns()) {
        byte [][] famQf = KeyValue.parseColumn(getBytes(column));
        if(famQf.length == 1) {
          scan.addFamily(famQf[0]);
        } else {
          scan.addColumn(famQf[0], famQf[1]);
        }
      }
    }
    if (tScan.isSetFilterString()) {
      ParseFilter parseFilter = new ParseFilter();
      scan.setFilter(
          parseFilter.parseFilterString(tScan.getFilterString()));
    }
    if (tScan.isSetReversed()) {
      scan.setReversed(tScan.isReversed());
    }
    return addScanner(table.getScanner(scan), tScan.sortColumns);
  } catch (IOException e) {
    LOG.warn(e.getMessage(), e);
    throw new IOError(Throwables.getStackTraceAsString(e));
  } finally{
    closeTable(table);
  }
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:52,代码来源:ThriftServerRunner.java


示例9: scannerOpenWithScan

import org.apache.hadoop.hbase.thrift.generated.TScan; //导入依赖的package包/类
@Override
public int scannerOpenWithScan(ByteBuffer tableName, TScan tScan,
    Map<ByteBuffer, ByteBuffer> attributes)
    throws IOError {
  try {
    HTable table = getTable(tableName);
    Scan scan = new Scan();
    addAttributes(scan, attributes);
    if (tScan.isSetStartRow()) {
      scan.setStartRow(tScan.getStartRow());
    }
    if (tScan.isSetStopRow()) {
      scan.setStopRow(tScan.getStopRow());
    }
    if (tScan.isSetTimestamp()) {
      scan.setTimeRange(0, tScan.getTimestamp());
    }
    if (tScan.isSetCaching()) {
      scan.setCaching(tScan.getCaching());
    }
    if (tScan.isSetBatchSize()) {
      scan.setBatch(tScan.getBatchSize());
    }
    if (tScan.isSetColumns() && tScan.getColumns().size() != 0) {
      for(ByteBuffer column : tScan.getColumns()) {
        byte [][] famQf = KeyValue.parseColumn(getBytes(column));
        if(famQf.length == 1) {
          scan.addFamily(famQf[0]);
        } else {
          scan.addColumn(famQf[0], famQf[1]);
        }
      }
    }
    if (tScan.isSetFilterString()) {
      ParseFilter parseFilter = new ParseFilter();
      scan.setFilter(
          parseFilter.parseFilterString(tScan.getFilterString()));
    }
    return addScanner(table.getScanner(scan), tScan.sortColumns);
  } catch (IOException e) {
    LOG.warn(e.getMessage(), e);
    throw new IOError(e.getMessage());
  }
}
 
开发者ID:tenggyut,项目名称:HIndex,代码行数:45,代码来源:ThriftServerRunner.java


示例10: scanOneColumn

import org.apache.hadoop.hbase.thrift.generated.TScan; //导入依赖的package包/类
/**
 * scan 讀取特定column
 *
 * @throws Exception
 */
@Test
// 1053 at mills.
// 897 at mills.
// 888 at mills.
public void scanOneColumn() throws Exception {
	// String TABLE_NAME = "ItemCreation_Buffer_Item";
	// String rowKey =
	// "0016630555\\x0501\\x0501\\x05A1FS\\x05CreateItem\\x0516630555\\x050000116\\x05670744-086876166705";
	// String cloumn = "ItemInfo:SellerId";

	String TABLE_NAME = "UIH_OverallItemInfo";
	String rowKey = "1000|I200|A17P|AUDI15028071";
	String cloumn = "CommonInfo:SellerID";

	List<TRowResult> results = null;
	//
	List<ByteBuffer> columns = new LinkedList<ByteBuffer>();
	columns.add(ByteBufferHelper.toByteBuffer(cloumn));
	Map<ByteBuffer, ByteBuffer> attributes = new HashMap<ByteBuffer, ByteBuffer>();
	//
	TScan scan = new TScan();
	scan.setCaching(200);
	scan.setStartRow(ByteBufferHelper.toByteBuffer(rowKey));
	// scan.setStopRow(ByteBufferHelper.toByteBuffer(rowKey));
	scan.setColumns(columns);
	//
	int scannerId = 0;
	long beg = System.currentTimeMillis();
	try {
		scannerId = client.scannerOpenWithScan(
				ByteBufferHelper.toByteBuffer(TABLE_NAME), scan, attributes);// 可以attributes=null
		results = client.scannerGetList(scannerId, 10);// 讀取幾筆
	} catch (Exception ex) {
		ex.printStackTrace();
	} finally {
		if (scannerId >= 0) {
			client.scannerClose(scannerId);// 一定要關閉
		}
	}
	long end = System.currentTimeMillis();
	System.out.println((end - beg) + " at mills.");
	printlnResult(results);
}
 
开发者ID:mixaceh,项目名称:openyu-commons,代码行数:49,代码来源:HBaseThriftDMLTest.java


示例11: scanNotClose

import org.apache.hadoop.hbase.thrift.generated.TScan; //导入依赖的package包/类
@Test
public void scanNotClose() throws Exception {
	String TABLE_NAME = "ItemCreation_Buffer_Item_B";
	String cloumn = "ItemInfo:ProcessResult";
	//
	List<ByteBuffer> columns = new LinkedList<ByteBuffer>();
	columns.add(ByteBufferHelper.toByteBuffer(cloumn));
	columns.add(ByteBufferHelper.toByteBuffer("ItemInfo:ProcessStatus"));
	Map<ByteBuffer, ByteBuffer> attributes = new HashMap<ByteBuffer, ByteBuffer>();
	//
	TScan scan = new TScan();
	scan.setCaching(200);
	//
	String filterString = "SingleColumnValueFilter('ItemInfo','ProcessResult',=,'substring:Test')";// substring:A17P
	filterString += " AND SingleColumnValueFilter('ItemInfo','ProcessStatus',=,'substring:Test')";
	scan.setFilterString(ByteBufferHelper.toByteBuffer(filterString));
	scan.setColumns(columns);
	//
	int scannerId = 0;
	int rowCount = 0;
	long beg = System.currentTimeMillis();
	for (int i = 0; i < 1000; i++) {
		try {
			scannerId = client.scannerOpenWithScan(
					ByteBufferHelper.toByteBuffer(TABLE_NAME), scan,
					attributes);// 可以attributes=null
			// System.out.println(scannerId);
			while (true) {
				List<TRowResult> results = client.scannerGet(scannerId);
				if (results.isEmpty()) {
					break;
				}
				System.out.println(i + ", " + scannerId);
				// printlnResult(results);
				rowCount++;

				if (rowCount > 0) {
					break;
				}
			}

		} catch (Exception ex) {
			ex.printStackTrace();
		} finally {
			if (scannerId >= 0) {
				// 故意不關
				// client.scannerClose(scannerId);// 一定要關閉
			}
		}
	}
	//
	long end = System.currentTimeMillis();
	System.out.println((end - beg) + " at mills.");
}
 
开发者ID:mixaceh,项目名称:openyu-commons,代码行数:55,代码来源:HBaseThriftDMLTest.java


示例12: singleColumnValueFilter

import org.apache.hadoop.hbase.thrift.generated.TScan; //导入依赖的package包/类
@Test
public void singleColumnValueFilter() throws Exception {
	String TABLE_NAME = "UIH_OverallItemInfo";
	String cloumn = "CommonInfo:SellerID";

	List<TRowResult> results = null;
	//
	List<ByteBuffer> columns = new LinkedList<ByteBuffer>();
	columns.add(ByteBufferHelper.toByteBuffer(cloumn));
	columns.add(ByteBufferHelper.toByteBuffer("CommonInfo:SellerItemNumber"));
	Map<ByteBuffer, ByteBuffer> attributes = new HashMap<ByteBuffer, ByteBuffer>();
	//
	TScan scan = new TScan();
	scan.setCaching(200);
	// SingleColumnValueFilter('<family>', '<qualifier>', <compare
	// operator>, '<comparator>', <filterIfColumnMissing_boolean>,
	// <latest_version_boolean>)

	// 注意: 只有當COLUMNS中包含SingleColumnValueFilter提到的欄位時,
	// 該SingleColumnValueFilter才有效的

	String filterString = "SingleColumnValueFilter('CommonInfo','SellerID',=,'binary:A17P')";// substring:A17P
	filterString += " AND SingleColumnValueFilter('CommonInfo','SellerItemNumber',=,'binary:AUDI15028005')";
	scan.setFilterString(ByteBufferHelper.toByteBuffer(filterString));
	scan.setColumns(columns);
	//
	int scannerId = 0;
	long beg = System.currentTimeMillis();
	try {
		scannerId = client.scannerOpenWithScan(
				ByteBufferHelper.toByteBuffer(TABLE_NAME), scan, attributes);// 可以attributes=null
		results = client.scannerGetList(scannerId, 10);// 讀取幾筆
	} catch (Exception ex) {
		ex.printStackTrace();
	} finally {
		if (scannerId >= 0) {
			client.scannerClose(scannerId);// 一定要關閉
		}
	}
	long end = System.currentTimeMillis();
	System.out.println((end - beg) + " at mills.");
	printlnResult(results);
}
 
开发者ID:mixaceh,项目名称:openyu-commons,代码行数:44,代码来源:HBaseThriftDMLTest.java


示例13: scannerOpenWithScan

import org.apache.hadoop.hbase.thrift.generated.TScan; //导入依赖的package包/类
@Override
public int scannerOpenWithScan(ByteBuffer tableName, TScan tScan,
    Map<ByteBuffer, ByteBuffer> attributes)
    throws IOError {

  Table table = null;
  try {
    table = getTable(tableName);
    Scan scan = new Scan();
    addAttributes(scan, attributes);
    if (tScan.isSetStartRow()) {
      scan.setStartRow(tScan.getStartRow());
    }
    if (tScan.isSetStopRow()) {
      scan.setStopRow(tScan.getStopRow());
    }
    if (tScan.isSetTimestamp()) {
      scan.setTimeRange(0, tScan.getTimestamp());
    }
    if (tScan.isSetCaching()) {
      scan.setCaching(tScan.getCaching());
    }
    if (tScan.isSetBatchSize()) {
      scan.setBatch(tScan.getBatchSize());
    }
    if (tScan.isSetColumns() && tScan.getColumns().size() != 0) {
      for(ByteBuffer column : tScan.getColumns()) {
        byte [][] famQf = CellUtil.parseColumn(getBytes(column));
        if(famQf.length == 1) {
          scan.addFamily(famQf[0]);
        } else {
          scan.addColumn(famQf[0], famQf[1]);
        }
      }
    }
    if (tScan.isSetFilterString()) {
      ParseFilter parseFilter = new ParseFilter();
      scan.setFilter(
          parseFilter.parseFilterString(tScan.getFilterString()));
    }
    if (tScan.isSetReversed()) {
      scan.setReversed(tScan.isReversed());
    }
    if (tScan.isSetCacheBlocks()) {
      scan.setCacheBlocks(tScan.isCacheBlocks());
    }
    return addScanner(table.getScanner(scan), tScan.sortColumns);
  } catch (IOException e) {
    LOG.warn(e.getMessage(), e);
    throw getIOError(e);
  } finally{
    closeTable(table);
  }
}
 
开发者ID:apache,项目名称:hbase,代码行数:55,代码来源:ThriftServerRunner.java


示例14: scannerOpenWithScan

import org.apache.hadoop.hbase.thrift.generated.TScan; //导入依赖的package包/类
@Override
public int scannerOpenWithScan(ByteBuffer tableName, TScan tScan,
    Map<ByteBuffer, ByteBuffer> attributes)
    throws IOError {
  try {
    HTable table = getTable(tableName);
    Scan scan = new Scan();
    addAttributes(scan, attributes);
    if (tScan.isSetStartRow()) {
      scan.setStartRow(tScan.getStartRow());
    }
    if (tScan.isSetStopRow()) {
      scan.setStopRow(tScan.getStopRow());
    }
    if (tScan.isSetTimestamp()) {
      scan.setTimeRange(0, tScan.getTimestamp());
    }
    if (tScan.isSetCaching()) {
      scan.setCaching(tScan.getCaching());
    }
    if (tScan.isSetBatchSize()) {
      scan.setBatch(tScan.getBatchSize());
    }
    if (tScan.isSetColumns() && tScan.getColumns().size() != 0) {
      for(ByteBuffer column : tScan.getColumns()) {
        byte [][] famQf = KeyValue.parseColumn(getBytes(column));
        if(famQf.length == 1) {
          scan.addFamily(famQf[0]);
        } else {
          scan.addColumn(famQf[0], famQf[1]);
        }
      }
    }
    if (tScan.isSetFilterString()) {
      ParseFilter parseFilter = new ParseFilter();
      scan.setFilter(
          parseFilter.parseFilterString(tScan.getFilterString()));
    }
    if (tScan.isSetReversed()) {
      scan.setReversed(tScan.isReversed());
    }
    return addScanner(table.getScanner(scan), tScan.sortColumns);
  } catch (IOException e) {
    LOG.warn(e.getMessage(), e);
    throw new IOError(e.getMessage());
  }
}
 
开发者ID:shenli-uiuc,项目名称:PyroDB,代码行数:48,代码来源:ThriftServerRunner.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java PsiMethodCallExpression类代码示例发布时间:2022-05-21
下一篇:
Java FabricMySQLConnection类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap