Rename emergency to panic
This commit is contained in:
parent
13d213f5f2
commit
dabbf4e7e4
@ -8,7 +8,6 @@ import it.unimi.dsi.fastutil.io.FastByteArrayOutputStream
|
|||||||
import it.unimi.dsi.fastutil.objects.Object2IntAVLTreeMap
|
import it.unimi.dsi.fastutil.objects.Object2IntAVLTreeMap
|
||||||
import it.unimi.dsi.fastutil.objects.ObjectArrayList
|
import it.unimi.dsi.fastutil.objects.ObjectArrayList
|
||||||
import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet
|
import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet
|
||||||
import ru.dbotthepony.kommons.util.CarriedExecutor
|
|
||||||
import ru.dbotthepony.kommons.util.KOptional
|
import ru.dbotthepony.kommons.util.KOptional
|
||||||
import java.io.Closeable
|
import java.io.Closeable
|
||||||
import java.io.DataInputStream
|
import java.io.DataInputStream
|
||||||
@ -19,11 +18,7 @@ import java.io.OutputStream
|
|||||||
import java.io.RandomAccessFile
|
import java.io.RandomAccessFile
|
||||||
import java.nio.ByteBuffer
|
import java.nio.ByteBuffer
|
||||||
import java.util.*
|
import java.util.*
|
||||||
import java.util.concurrent.CompletableFuture
|
|
||||||
import java.util.concurrent.Executor
|
|
||||||
import java.util.concurrent.TimeUnit
|
|
||||||
import java.util.function.IntConsumer
|
import java.util.function.IntConsumer
|
||||||
import java.util.function.Supplier
|
|
||||||
import java.util.stream.IntStream
|
import java.util.stream.IntStream
|
||||||
import java.util.stream.Stream
|
import java.util.stream.Stream
|
||||||
import kotlin.collections.ArrayList
|
import kotlin.collections.ArrayList
|
||||||
@ -138,7 +133,7 @@ class BTreeDB6 private constructor(val file: File, private var reader: RandomAcc
|
|||||||
|
|
||||||
occupiedBlocksBitmap = BitSet.valueOf(ByteBuffer.wrap(bytes.elements(), 0, bytes.size))
|
occupiedBlocksBitmap = BitSet.valueOf(ByteBuffer.wrap(bytes.elements(), 0, bytes.size))
|
||||||
} else if (rootBlockIndex > 0) {
|
} else if (rootBlockIndex > 0) {
|
||||||
emergency()
|
panic()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -165,14 +160,14 @@ class BTreeDB6 private constructor(val file: File, private var reader: RandomAcc
|
|||||||
* This method creates new file, and tries to recover current file's contents
|
* This method creates new file, and tries to recover current file's contents
|
||||||
* into new file.
|
* into new file.
|
||||||
*/
|
*/
|
||||||
private fun emergency() {
|
private fun panic() {
|
||||||
throw IllegalStateException("emergency() has been called, but currently we can't recover corrupt file!")
|
throw IllegalStateException("panic() has been called, but currently we can't recover corrupt file!")
|
||||||
}
|
}
|
||||||
|
|
||||||
private val headerBuf = ByteArray(16)
|
private val headerBuf = ByteArray(16)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks free bitmap for validity
|
* Checks free bitmap for consistency with file's contents
|
||||||
*/
|
*/
|
||||||
fun checkFreeBitmap() {
|
fun checkFreeBitmap() {
|
||||||
val length = reader.length()
|
val length = reader.length()
|
||||||
|
Loading…
Reference in New Issue
Block a user