import io.netty.buffer.ByteBuf;
import java.io.IOException;
+import java.io.UncheckedIOException;
import java.nio.channels.FileChannel;
import org.eclipse.jdt.annotation.NonNull;
try {
bytesRead = buffer.writeBytes(channel, readPosition, readAtLeast);
} catch (IOException e) {
- throw new StorageException(e);
+ throw new UncheckedIOException(e);
}
verify(bytesRead >= readAtLeast, "Short read %s, expected %s", bytesRead, readAtLeast);
}
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import java.io.IOException;
+import java.io.UncheckedIOException;
import java.nio.channels.FileChannel;
/**
try {
ZERO_ENTRY_HEADER.getBytes(0, channel, position, HEADER_BYTES);
} catch (IOException e) {
- throw new StorageException(e);
+ throw new UncheckedIOException(e);
}
}
try {
entry.readBytes(channel, position, entry.readableBytes());
} catch (IOException e) {
- throw new StorageException(e);
+ throw new UncheckedIOException(e);
}
}
try {
channel.force(true);
} catch (IOException e) {
- throw new StorageException(e);
+ throw new UncheckedIOException(e);
}
}
}
import io.atomix.storage.journal.index.Position;
import io.atomix.storage.journal.index.SparseJournalIndex;
import java.io.IOException;
+import java.io.UncheckedIOException;
import java.nio.file.Files;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
fileReader.release();
}
} catch (IOException e) {
- throw new StorageException(e);
+ throw new UncheckedIOException(e);
}
}
try {
ret = ((Inactive) state).activate(this);
} catch (IOException e) {
- throw new StorageException(e);
+ throw new UncheckedIOException(e);
}
state = ret;
return ret;
try {
file.close();
} catch (IOException e) {
- throw new StorageException(e);
+ throw new UncheckedIOException(e);
}
}
try {
Files.deleteIfExists(file.path());
} catch (IOException e) {
- throw new StorageException(e);
+ throw new UncheckedIOException(e);
}
}
import io.atomix.storage.journal.index.JournalIndex;
import java.io.EOFException;
import java.io.IOException;
+import java.io.UncheckedIOException;
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.jdt.annotation.Nullable;
import org.opendaylight.controller.raft.journal.ToByteBufMapper;
try {
fileWriter.flush();
} catch (IOException e) {
- throw new StorageException(e);
+ throw new UncheckedIOException(e);
}
}
}
import io.netty.buffer.ByteBufAllocator;
import java.io.File;
import java.io.IOException;
+import java.io.UncheckedIOException;
import java.nio.file.Path;
import java.util.Collection;
import java.util.TreeMap;
try {
return segment.file().size();
} catch (IOException e) {
- throw new StorageException(e);
+ throw new UncheckedIOException(e);
}
})
.sum();
.withUpdated(System.currentTimeMillis())
.build());
} catch (IOException e) {
- throw new StorageException(e);
+ throw new UncheckedIOException(e);
}
final var segment = new JournalSegment(file, storageLevel, maxEntrySize, indexDensity);
try {
segmentFile = JournalSegmentFile.openExisting(filePath, allocator);
} catch (IOException e) {
- throw new StorageException(e);
+ throw new UncheckedIOException(e);
}
// Load the segment.
+++ /dev/null
-/*
- * Copyright 2015-2021 Open Networking Foundation
- * Copyright 2023 PANTHEON.tech, s.r.o.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.atomix.storage.journal;
-
-/**
- * Log exception.
- *
- * @author <a href="http://github.com/kuujo">Jordan Halterman</a>
- */
-public class StorageException extends RuntimeException {
- @java.io.Serial
- private static final long serialVersionUID = 1L;
-
- public StorageException(final Throwable cause) {
- super(cause);
- }
-}