Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 4104C200CC6 for ; Tue, 18 Jul 2017 21:11:25 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 3F6BD16767A; Tue, 18 Jul 2017 19:11:25 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 5A41E167674 for ; Tue, 18 Jul 2017 21:11:24 +0200 (CEST) Received: (qmail 98096 invoked by uid 500); 18 Jul 2017 19:11:21 -0000 Mailing-List: contact user-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@hbase.apache.org Delivered-To: mailing list user@hbase.apache.org Received: (qmail 98058 invoked by uid 99); 18 Jul 2017 19:11:21 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 18 Jul 2017 19:11:21 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 98F9C1A0AC7 for ; Tue, 18 Jul 2017 19:11:20 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.379 X-Spam-Level: ** X-Spam-Status: No, score=2.379 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id yNrYH4how6u4 for ; Tue, 18 Jul 2017 19:11:18 +0000 (UTC) Received: from mail-yb0-f177.google.com (mail-yb0-f177.google.com [209.85.213.177]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id EE45D5F6C6 for ; Tue, 18 Jul 2017 19:11:17 +0000 (UTC) Received: by mail-yb0-f177.google.com with SMTP id z37so9639731ybh.1 for ; Tue, 18 Jul 2017 12:11:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=cwytQogvVbpTm8fIJbbBpNIa6apLNqr0T3vGglrOjwI=; b=lLqtY4FLh4VWkEpMXdfHvSV6FhCSShSgHl2SpsCp2WM4jtcjCDpWxD/2I/wRTrZfkN AGVG51I61qRbg+zpfEIHT7qeBSDcPWQ6v/URgU0FRn1qAjPjdz1WU28gUzKuU459ycKS 4I9aODxF6HxmrtGsLbXoeboCMhwoiP+837czGgZLrVc4w39p+LBayzbRBYgFOhsUSCvO tToz4dgF2uGkZINt5/jIz9/j/xSIC6xnEaPJhQEfe++rLQutCCSLv9poZ9/64bC8eY7v aI3TFGj23B30hcDD4f4rd9Uq3eY+QrR0SBjgDmU61aWn5kzxtA1UKm7ooaS+/aR6A1ae hn5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=cwytQogvVbpTm8fIJbbBpNIa6apLNqr0T3vGglrOjwI=; b=feph2epczVaFupZaVIpcuG5V8JOax0EvUaLjTN0uCMzDK8XgWlJa38cV6hTnk+vUzF lSScd6hp/A7uhpem+eZ4AbqBk09tCETurhCUc+UCaoM6WvO6VQUSALkrsIIrOMjwuBTU BIOol1o8iha6tNlmSZjfR0hbuk43nGTlkhid8LAjRpqsTGg0xXGaXxE8AOIM4z5p/dDj l+GjA/HE4fdst5THzx1w9pzZfQJiZevONSeUZanwVh5zjc4IiQEqOk0xyircLgch6N8Y SKTTABQIpCgUP6xHo7a0cwi15FrPlzM9y7B3Fxe7G4y/pijFIyY/WK4bsLkNOLXvz40c 6Cgg== X-Gm-Message-State: AIVw110s/+x1CiSYWSn2xlhm+sj/E0chz2YkyhiGUiQGQYU5SFgMSxjr DVT4aqvx69+aaMsy6M/iKzY6ObzQH4Ts X-Received: by 10.37.34.68 with SMTP id i65mr2547617ybi.191.1500405070519; Tue, 18 Jul 2017 12:11:10 -0700 (PDT) MIME-Version: 1.0 Received: by 10.37.231.78 with HTTP; Tue, 18 Jul 2017 12:11:10 -0700 (PDT) In-Reply-To: References: From: Ted Yu Date: Tue, 18 Jul 2017 12:11:10 -0700 Message-ID: Subject: Re: How does hbase find regionservers for scans To: "user@hbase.apache.org" Content-Type: multipart/alternative; boundary="001a1143269a3f689e05549c47be" archived-at: Tue, 18 Jul 2017 19:11:25 -0000 --001a1143269a3f689e05549c47be Content-Type: text/plain; charset="UTF-8" For #1, the timestamp currently is stored using epoch in milliseconds on server side. For #2, PrefixFilter should also work. I peformed the following on a small table: scan 't', {FILTER => "PrefixFilter('111')"} which returned the two. Cheers On Tue, Jul 18, 2017 at 11:36 AM, S L wrote: > Thanks for the tip with RowPrefixFilter. THAT works compared to > PrefixFilter. However, regarding the timerange, when i type in the > epoch time, that returns 0 rows. However, if I use epoch time in > milliseconds, that returns tons of rows. > > I have more questions now: > 1) Why does my hbase work wtih epoch in milliseconds but your example > says to use epoch seconds. > 2) Also, how do you use PrefixFilter because I thought PrefixFilter > was what I needed via common sense but apparently my common sense > didn't work. > > Thanks for answering all my questions the last couple weeks. > > scan 'dbi_based_data', {ROWPREFIXFILTER=> '26', COLUMNS => > 'raw_data:processlist', TIMERANGE => [1499205600, 1499206200]} > > ROW COLUMN+CELL > > 0 row(s) in 0.2350 seconds > > > scan 'dbi_based_data', {ROWPREFIXFILTER=> '26', COLUMNS => > 'raw_data:processlist', TIMERANGE => [1499205600000, 1499206200000]} > > > > > 26_p3419.db160151.ycg1.dbi_149920 column=raw_data:processlist, > timestamp=1499206083343, value= > > 351 row(s) in 184.6360 seconds > > > > > On Fri, Jul 14, 2017 at 8:14 PM, Ted Yu wrote: > > > > I wonder what time unit you were using. > > > > From the example in hbase-shell/src/main/ruby/shell/commands/scan.rb : > > > > hbase> scan 't1', {COLUMNS => 'c1', TIMERANGE => [1303668804, > 1303668904]} > > > > You can see the time range having much smaller values. > > > > Please look at ROWPREFIXFILTER example in the same scan.rb > > > > If you check the table UI for dbi_based_data, you would see the start key > > of each region. > > From there it is easy to pinpoint which server hosts the relevant region. > > > > Cheers > > > > On Fri, Jul 14, 2017 at 7:51 PM, S L wrote: > > > > > Sorry if this is a basic question. How does hbase determine which > > > regionserver the rows are supposed to be stored on? My rowkey looks > like > > > hash_servername_timestamp, e.g. > > > > > > 33_myserver.mydomain.com_1234567890 > > > > > > If I run the following command: > > > > > > scan 'dbi_based_data', {FILTER => "PrefixFilter('0')", COLUMNS => > > > 'raw_data:processlist', TIMERANGE => [1499205600000, 1499206200000]} > > > > > > I get all the rows that start with "0". Since hbase stores things in > > > lexical order, it seems like all rows that were stored lexically first > gets > > > returned. > > > > > > However, if I run the following command, hbase times out. Even if I > extend > > > the timeout period to 3 minutes, it still times out. > > > > > > scan 'dbi_based_data', {FILTER => "PrefixFilter('28')", COLUMNS => > > > 'raw_data:processlist', TIMERANGE => [1499205600000, 1499206200000]} > > > > > > It seems like if it was any other prefix other than "0", it times out > (like > > > above prefix = 28). I don't understand why it would timeout since it > > > should be able to calculate which region/regionserver it should go to > since > > > I gave it the prefix to use. > > > > > > > > > I performed "hbase hbck" and it says that > > > > > > 9 region servers are alive, 2 are dead > > > > > > # of total regions is 15850 for the db but there's only 350 for the > table > > > I'm querying. There are 0 inconsistencies so the status is "OK". > > > > > > Thanks in advance for any help you can give me. > > > > --001a1143269a3f689e05549c47be--