Example #1
0
        /// <summary>
        ///    Get the specified columns
        /// </summary>
        /// <param name="rowKey">rowkey</param>
        /// <param name="columns">columns</param>
        /// <exception cref="IOErrorException"></exception>
        /// <exception cref="ArgumentNullException"></exception>
        /// <exception cref="CommunicationTimeoutException"></exception>
        /// <exception cref="CommunicationFailException"></exception>
        /// <returns></returns>
        public RowInfo GetRow(byte[] rowKey, List <string> columns)
        {
            if (rowKey == null || rowKey.Length == 0)
            {
                throw new ArgumentNullException("rowKey");
            }
            if (columns == null || columns.Count == 0)
            {
                return(GetRow(rowKey));
            }
            IPEndPoint iep = _regionManager.GetRegionByRowKey(rowKey);

            RowInfo[] infos = _client.GetRowWithColumnsFromTable(TableName, rowKey, columns.ToArray(), iep);
            if (infos == null || infos.Length == 0)
            {
                return(null);
            }
            return(infos[0]);
        }