hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug Meil <doug.m...@explorysmedical.com>
Subject Re: HTable thread safe for read?
Date Sun, 14 Aug 2011 13:29:47 GMT

I wouldn't do it...   Some of the other committers can comment more on
this, but there is state cached in HTable instances when scanning.


 protected class ClientScanner implements ResultScanner {
    private final Log CLIENT_LOG = LogFactory.getLog(this.getClass());
    // HEADSUP: The scan internal start row can change as we move through
    private Scan scan;
    private boolean closed = false;
    // Current region scanner is against.  Gets cleared if current region
    // wonky: e.g. if it splits on us.
    private HRegionInfo currentRegion = null;
    private ScannerCallable callable = null;
    private final LinkedList<Result> cache = new LinkedList<Result>();
    private final int caching;
    private long lastNext;
    // Keep lastResult returned successfully in case we have to reset
    private Result lastResult = null;

On 8/14/11 3:24 AM, "Yi Liang" <whitesky@gmail.com> wrote:

>From the javadoc of HTable:
>"This class is not thread safe for updates; the underlying write buffer
>can be corrupted if multiple threads contend over a single HTable
>Does that mean HTable is thread safe if we only use it to get rows?

View raw message