Example #1
0
        /// <summary>
        ///    获取一段范围的数据行
        /// </summary>
        /// <param name="startKey">查询起始key值</param>
        /// <param name="endKey">查询终止key值</param>
        /// <param name="columns">指定列名。当值为列族名时返回列族所有所有列数据</param>
        /// <param name="attribute">attribute</param>
        /// <exception cref="IOErrorException">IO错误</exception>
        /// <exception cref="ArgumentNullException">参数不能为空</exception>
        /// <exception cref="CommunicationTimeoutException">通信超时</exception>
        /// <exception cref="CommunicationFailException">通信失败</exception>
        /// <returns>Scanner对象</returns>
        public Scanner NewScanner(byte[] startKey, byte[] endKey, List <string> columns, Dictionary <string, string> attribute = null)
        {
            if (columns == null)
            {
                throw new ArgumentNullException("columns");
            }
            if (columns.Count == 0)
            {
                throw new ArgumentException("columns are undefined");
            }
            IPEndPoint iep       = _regionManager.GetRegionByRowKey(startKey);
            int        scannerId = _client.GetScannerOpenWithStop(TableName, startKey, endKey, iep, columns.ToArray());

            return(new Scanner(scannerId, _client, iep));
        }