Package org.apache.activemq.kaha

Examples of org.apache.activemq.kaha.StoreLocation


    protected synchronized IndexItem write(Object key, Object value) {
        IndexItem index = null;
        try {
            index = indexManager.createNewIndex();
            StoreLocation data = dataManager.storeDataItem(keyMarshaller, key);
            index.setKeyData(data);

            if (value != null) {
                data = dataManager.storeDataItem(valueMarshaller, value);
                index.setValueData(data);
View Full Code Here


        this.indexManager = im;
        this.dataManager = dfm;
        long nextItem = root.getNextItem();
        while (nextItem != Item.POSITION_NOT_SET) {
            StoreEntry item = indexManager.getIndex(nextItem);
            StoreLocation data = item.getKeyDataItem();
            Object key = dataManager.readItem(ROOT_MARSHALLER, data);
            map.put(key, item);
            list.add(item);
            nextItem = item.getNextItem();
            dataManager.addInterestInFile(item.getKeyFile());
View Full Code Here

    IndexItem addRoot(IndexManager containerIndexManager, ContainerId key) throws IOException {
        if (map.containsKey(key)) {
            removeRoot(containerIndexManager, key);
        }

        StoreLocation data = dataManager.storeDataItem(ROOT_MARSHALLER, key);
        IndexItem newRoot = indexManager.createNewIndex();
        newRoot.setKeyData(data);
        IndexItem containerRoot = containerIndexManager.createNewIndex();
        containerIndexManager.storeIndex(containerRoot);
        newRoot.setValueOffset(containerRoot.getOffset());
View Full Code Here

    protected synchronized IndexItem writeLast(Object value) {
        IndexItem index = null;
        try {
            if (value != null) {
                StoreLocation data = dataManager.storeDataItem(marshaller, value);
                index = indexManager.createNewIndex();
                index.setValueData(data);
                IndexItem prev = indexList.getLast();
                prev = prev != null ? prev : root;
                IndexItem next = indexList.getNextEntry(prev);
View Full Code Here

    protected synchronized IndexItem writeFirst(Object value) {
        IndexItem index = null;
        try {
            if (value != null) {
                StoreLocation data = dataManager.storeDataItem(marshaller, value);
                index = indexManager.createNewIndex();
                index.setValueData(data);
                IndexItem prev = root;
                IndexItem next = indexList.getNextEntry(prev);
                prev.setNextItem(index.getOffset());
View Full Code Here

    protected synchronized IndexItem insert(int insertPos, Object value) {
        IndexItem index = null;
        try {
            if (value != null) {
                StoreLocation data = dataManager.storeDataItem(marshaller, value);
                index = indexManager.createNewIndex();
                index.setValueData(data);
                IndexItem prev = null;
                IndexItem next = null;
                if (insertPos <= 0) {
View Full Code Here

    protected synchronized Object getValue(StoreEntry item) {
        Object result = null;
        if (item != null) {
            try {
                StoreLocation data = item.getValueDataItem();
                result = dataManager.readItem(marshaller, data);
            } catch (IOException e) {
                LOG.error("Failed to get value for " + item, e);
                throw new RuntimeStoreException(e);
            }
View Full Code Here

        this.indexManager = im;
        this.dataManager = dfm;
        long nextItem = root.getNextItem();
        while (nextItem != Item.POSITION_NOT_SET) {
            StoreEntry item = indexManager.getIndex(nextItem);
            StoreLocation data = item.getKeyDataItem();
            Object key = dataManager.readItem(ROOT_MARSHALLER, data);
            map.put(key, item);
            list.add(item);
            nextItem = item.getNextItem();
            dataManager.addInterestInFile(item.getKeyFile());
View Full Code Here

    IndexItem addRoot(IndexManager containerIndexManager, ContainerId key) throws IOException {
        if (map.containsKey(key)) {
            removeRoot(containerIndexManager, key);
        }

        StoreLocation data = dataManager.storeDataItem(ROOT_MARSHALLER, key);
        IndexItem newRoot = indexManager.createNewIndex();
        newRoot.setKeyData(data);
        IndexItem containerRoot = containerIndexManager.createNewIndex();
        containerIndexManager.storeIndex(containerRoot);
        newRoot.setValueOffset(containerRoot.getOffset());
View Full Code Here

                    init();
                    index.load();
                    long nextItem = root.getNextItem();
                    while (nextItem != Item.POSITION_NOT_SET) {
                        IndexItem item = indexManager.getIndex(nextItem);
                        StoreLocation data = item.getKeyDataItem();
                        Object key = dataManager.readItem(keyMarshaller, data);
                        if (index.isTransient()) {
                            index.store(key, item);
                        }
                        indexList.add(item);
View Full Code Here

TOP

Related Classes of org.apache.activemq.kaha.StoreLocation

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.