Package com.taobao.common.store.util

Examples of com.taobao.common.store.util.BytesKey


     *
     * @see com.taobao.common.store.Store#add(byte[], byte[])
     */
    @Override
    public void add(final byte[] key, final byte[] data) throws IOException {
        this.datas.put(new BytesKey(key), data);
    }
View Full Code Here


    }


    @Override
    public void add(final byte[] key, final byte[] data, final boolean force) throws IOException {
        this.datas.put(new BytesKey(key), data);

    }
View Full Code Here

    }


    @Override
    public boolean remove(final byte[] key, final boolean force) throws IOException {
        return null != this.datas.remove(new BytesKey(key));
    }
View Full Code Here

     *
     * @see com.taobao.common.store.Store#get(byte[])
     */
    @Override
    public byte[] get(final byte[] key) throws IOException {
        return this.datas.get(new BytesKey(key));
    }
View Full Code Here

            }


            @Override
            public byte[] next() {
                final BytesKey key = it.next();
                if (null == key) {
                    return null;
                }
                return key.getData();
            }


            @Override
            public void remove() {
View Full Code Here

     *
     * @see com.taobao.common.store.Store#remove(byte[])
     */
    @Override
    public boolean remove(final byte[] key) throws IOException {
        return null != this.datas.remove(new BytesKey(key));
    }
View Full Code Here

     *
     * @see com.taobao.common.store.Store#update(byte[], byte[])
     */
    @Override
    public boolean update(final byte[] key, final byte[] data) throws IOException {
        this.datas.put(new BytesKey(key), data);
        return true;
    }
View Full Code Here

     * @param key
     * @throws IOException
     */
    private void reuse(final byte[] key, final boolean sync) throws IOException {
        final byte[] value = this.get(key);
        final long oldLastTime = this.lastModifiedMap.get(new BytesKey(key));
        if (value != null && this.remove(key)) {
            this.innerAdd(key, value, oldLastTime, sync);
        }
    }
View Full Code Here

     * @param data
     * @throws IOException
     */
    private OpItem innerAdd(final byte[] key, final byte[] data, final long oldLastTime, final boolean sync)
            throws IOException {
        final BytesKey k = new BytesKey(key);
        final OpItem op = new OpItem();
        op.op = OpItem.OP_ADD;
        this.dataFileAppender.store(op, k, data, sync);
        this.indices.put(k, op);
        if (oldLastTime == -1) {
View Full Code Here

     * @see com.taobao.common.store.Store#get(byte[])
     */
    @Override
    public byte[] get(final byte[] key) throws IOException {
        byte[] data = null;
        final BytesKey bytesKey = new BytesKey(key);
        data = this.dataFileAppender.getDataFromInFlyWrites(bytesKey);
        if (data != null) {
            return data;
        }
        final OpItem op = this.indices.get(bytesKey);
View Full Code Here

TOP

Related Classes of com.taobao.common.store.util.BytesKey

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.