Package org.elasticsearch.index.translog

Examples of org.elasticsearch.index.translog.TranslogException


            if (!raf.increaseRefCount()) {
                return null;
            }
            return new FsChannelSnapshot(this.id, raf, lastWrittenPosition.get(), operationCounter.get());
        } catch (Exception e) {
            throw new TranslogException(shardId, "Failed to snapshot", e);
        }
    }
View Full Code Here


        try {
            FsTranslogFile newFile;
            try {
                newFile = new FsTranslogFile(shardId, id, new RafReference(new File(location, "translog-" + id)));
            } catch (IOException e) {
                throw new TranslogException(shardId, "failed to create new translog file", e);
            }
            FsTranslogFile old = current;
            current = newFile;
            if (old != null) {
                // we might create a new translog overriding the current translog id
View Full Code Here

        rwl.writeLock().lock();
        try {
            assert this.trans == null;
            this.trans = new FsTranslogFile(shardId, id, new RafReference(new File(location, "translog-" + id)));
        } catch (IOException e) {
            throw new TranslogException(shardId, "failed to create new translog file", e);
        } finally {
            rwl.writeLock().unlock();
        }
    }
View Full Code Here

                    // ignore
                }
            }
            return location;
        } catch (Exception e) {
            throw new TranslogException(shardId, "Failed to write operation [" + operation + "]", e);
        } finally {
            rwl.readLock().unlock();
            CachedStreamOutput.pushEntry(cachedEntry);
        }
    }
View Full Code Here

                    FsChannelSnapshot snapshot = new FsChannelSnapshot(this.id, raf, lastWrittenPosition, operationCounter);
                    snapshot.seekTo(this.headerSize);
                    success = true;
                    return snapshot;
                } catch (Exception e) {
                    throw new TranslogException(shardId, "exception while creating snapshot", e);
                } finally {
                    rwl.writeLock().unlock();
                }
            } finally {
                if (!success) {
View Full Code Here

        try {
            if (!delete) {
                try {
                    sync();
                } catch (Exception e) {
                    throw new TranslogException(shardId, "failed to sync on close", e);
                }
            }
        } finally {
            raf.decreaseRefCount(delete);
        }
View Full Code Here

        rwl.writeLock().lock();
        try {
            flushBuffer();
            this.buffer = ((BufferingFsTranslogFile) other).buffer;
        } catch (IOException e) {
            throw new TranslogException(shardId, "failed to flush", e);
        } finally {
            rwl.writeLock().unlock();
        }
    }
View Full Code Here

                return;
            }
            flushBuffer();
            this.buffer = new byte[bufferSize];
        } catch (IOException e) {
            throw new TranslogException(shardId, "failed to flush", e);
        } finally {
            rwl.writeLock().unlock();
        }
    }
View Full Code Here

        try {
            if (!delete) {
                try {
                    sync();
                } catch (Exception e) {
                    throw new TranslogException(shardId, "failed to sync on close", e);
                }
            }
        } finally {
            raf.decreaseRefCount(delete);
        }
View Full Code Here

                    return snapshot;
                } finally {
                    rwl.writeLock().unlock();
                }
            } catch (FileNotFoundException e) {
                throw new TranslogException(shardId, "failed to create snapshot", e);
            } finally {
                if (!success) {
                    raf.decreaseRefCount(false);
                }
            }
View Full Code Here

TOP

Related Classes of org.elasticsearch.index.translog.TranslogException

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.