fix build files and move examples

This commit is contained in:
Greg Burd 2019-06-25 16:45:46 -04:00
parent 1d088e4a23
commit 6c2be56a72
320 changed files with 175 additions and 1201 deletions

6
NOTES Normal file
View file

@ -0,0 +1,6 @@
* Kafka for log
* Remove all @Deprecated features
* Nested transactions

View file

@ -22,14 +22,22 @@ inThisBuild(
url("https://greg.burd.me") url("https://greg.burd.me")
) )
), ),
scalaVersion := scala213, scalaVersion := scala212,
crossScalaVersions := List(scala213, scala212, scala211), crossScalaVersions := List(scala213, scala212, scala211),
resolvers += Resolver.sonatypeRepo("releases"), resolvers += Resolver.sonatypeRepo("releases"),
libraryDependencies ++= List( libraryDependencies ++= List(
scalatest.value % Test, scalatest.value % Test,
scalacheck % Test, scalacheck % Test,
scalametaTestkit % Test scalametaTestkit % Test
) ),
scalacOptions ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, 11)) => Seq("-target:jvm-1.8")
case Some((2, 12)) => Seq("-target:jvm-1.8")
case Some((2, 13)) => Seq("-target:jvm-1.8")
case _ => Seq.empty
}
}
) )
) )
@ -39,7 +47,8 @@ commands += Command.command("ci-test") { s =>
val scalaVersion = sys.env.get("TEST") match { val scalaVersion = sys.env.get("TEST") match {
case Some("2.11") => scala211 case Some("2.11") => scala211
case Some("2.12") => scala212 case Some("2.12") => scala212
case _ => scala213 case Some("2.13") => scala213
case _ => scala212
} }
val docsTest = if (scalaVersion == scala213) "docs/run" else "version" val docsTest = if (scalaVersion == scala213) "docs/run" else "version"
s"++$scalaVersion" :: s"++$scalaVersion" ::
@ -64,27 +73,19 @@ lazy val core = project
) )
.enablePlugins(BuildInfoPlugin) .enablePlugins(BuildInfoPlugin)
lazy val cli = project lazy val persist = project
.in(file("stasis-cli")) .in(file("stasis-persist"))
.settings( .settings(
moduleName := "stasis-cli", moduleName := "stasis-persist",
mainClass in assembly := Some("io.stasis.cli.Cli"), assemblyJarName.in(assembly) := "stasis-persist.jar",
assemblyJarName.in(assembly) := "stasis.jar", )
libraryDependencies ++= Seq( .dependsOn(core)
"com.googlecode.java-diff-utils" % "diffutils" % "1.3.0",
"com.martiansoftware" % "nailgun-server" % "0.9.1", lazy val rep = project
"com.github.scopt" %% "scopt" % "3.5.0", .in(file("stasis-rep"))
// undeclared transitive dependency of coursier-small .settings(
"org.scala-lang.modules" %% "scala-xml" % "1.1.1" moduleName := "stasis-rep",
), assemblyJarName.in(assembly) := "stasis-rep.jar"
scalacOptions ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, 11)) => Seq("-target:jvm-1.8")
case Some((2, 12)) => Seq("-target:jvm-1.8")
case Some((2, 13)) => Seq("-target:jvm-1.8")
case _ => Seq.empty
}
}
) )
.dependsOn(core) .dependsOn(core)
@ -105,6 +106,8 @@ lazy val buildInfoSettings: Seq[Def.Setting[_]] = Seq(
"stable" -> stableVersion.value, "stable" -> stableVersion.value,
"scala" -> scalaVersion.value, "scala" -> scalaVersion.value,
"scala211" -> scala211, "scala211" -> scala211,
"scala212" -> scala212,
"scala213" -> scala213,
"coursier" -> coursier, "coursier" -> coursier,
"commit" -> sys.process.Process("git rev-parse HEAD").lineStream_!.head, "commit" -> sys.process.Process("git rev-parse HEAD").lineStream_!.head,
"timestamp" -> System.currentTimeMillis().toString, "timestamp" -> System.currentTimeMillis().toString,

View file

@ -1,6 +1,5 @@
import sbt._ import sbt._
import sbt.Keys._ import sbt.Keys._
import org.scalajs.sbtplugin.ScalaJSPlugin.autoImport._
import org.portablescala.sbtplatformdeps.PlatformDepsPlugin.autoImport._ import org.portablescala.sbtplatformdeps.PlatformDepsPlugin.autoImport._
// scalafmt: { maxColumn = 120, style = defaultWithAlign } // scalafmt: { maxColumn = 120, style = defaultWithAlign }
@ -42,5 +41,5 @@ object Dependencies {
val metaconfig = Def.setting("com.geirsson" %%% "metaconfig-core" % metaconfigV) val metaconfig = Def.setting("com.geirsson" %%% "metaconfig-core" % metaconfigV)
val metaconfigTypesafe = Def.setting("com.geirsson" %%% "metaconfig-typesafe-config" % metaconfigV) val metaconfigTypesafe = Def.setting("com.geirsson" %%% "metaconfig-typesafe-config" % metaconfigV)
val metaconfigHocon = Def.setting("com.geirsson" %%% "metaconfig-hocon" % metaconfigV) val metaconfigHocon = Def.setting("com.geirsson" %%% "metaconfig-hocon" % metaconfigV)
} }

View file

@ -5,7 +5,7 @@ object Mima {
// After v0.5, start running mima checks in CI and document breaking changes here. // After v0.5, start running mima checks in CI and document breaking changes here.
// See https://github.com/typesafehub/migration-manager/wiki/sbt-plugin#basic-usage // See https://github.com/typesafehub/migration-manager/wiki/sbt-plugin#basic-usage
Seq( Seq(
// Essentially, only org.scalafmt.Scalafmt is protected by bincompat guarantees. // Essentially, only the following are protected by bincompat guarantees.
ProblemFilters.exclude[Problem]("io.stasis.cli.*"), ProblemFilters.exclude[Problem]("io.stasis.cli.*"),
) )
} }

View file

@ -11,7 +11,7 @@ addSbtPlugin("org.scalameta" % "sbt-mdoc" % "1.2.7")
addSbtPlugin("com.geirsson" % "sbt-scalafmt" % "1.6.0-RC4") addSbtPlugin("com.geirsson" % "sbt-scalafmt" % "1.6.0-RC4")
addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.2.2") addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.2.2")
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.7.0") addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.7.0")
addSbtPlugin("io.get-coursier" % "sbt-coursier" % "1.1.0-M14-4") //coursier.util.Properties.version) addSbtPlugin("io.get-coursier" % "sbt-coursier" % "2.0.0-RC2-3") //coursier.util.Properties.version)
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.7") addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.7")
addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.3.4") addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.3.4")
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "0.5.0") addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "0.5.0")

View file

@ -1,121 +0,0 @@
package org.scalafmt.cli
import com.martiansoftware.nailgun.NGContext
import java.io.{InputStream, PrintStream}
import org.scalafmt.Versions
import org.scalafmt.util.AbsoluteFile
import scala.util.control.NoStackTrace
object Cli {
def nailMain(nGContext: NGContext): Unit = {
val workingDirectory =
AbsoluteFile.fromPath(nGContext.getWorkingDirectory).getOrElse {
throw new IllegalStateException(
s"Expected absolute path, " +
s"obtained nGContext.getWorkingDirectory = ${nGContext.getWorkingDirectory}"
)
}
val exit = mainWithOptions(
nGContext.getArgs,
CliOptions.default.copy(
common = CliOptions.default.common.copy(
workingDirectory = workingDirectory,
out = nGContext.out,
in = nGContext.in,
err = nGContext.err
)
)
)
nGContext.exit(exit.code)
}
def main(
args: Array[String],
in: InputStream,
out: PrintStream,
err: PrintStream,
workingDirectory: String
): Unit = {
val options = CliOptions.default.copy(
common = CommonOptions(
in = in,
out = out,
err = err,
workingDirectory = AbsoluteFile.fromPath(workingDirectory).get
)
)
mainWithOptions(args, options)
}
private def throwIfError(exit: ExitCode): Unit = {
if (exit != ExitCode.Ok) {
throw new RuntimeException(exit.toString) with NoStackTrace
}
}
def main(args: Array[String]): Unit = {
val exit = mainWithOptions(args, CliOptions())
sys.exit(exit.code)
}
def exceptionThrowingMain(args: Array[String]): Unit = {
val exit = mainWithOptions(args, CliOptions.default)
throwIfError(exit)
}
def mainWithOptions(args: Array[String], options: CliOptions): ExitCode = {
getConfig(args, options) match {
case Some(x) => run(x)
case None => ExitCode.CommandLineArgumentError
}
}
def getConfig(args: Array[String], init: CliOptions): Option[CliOptions] = {
CliArgParser.scoptParser.parse(args, init).map(CliOptions.auto(args, init))
}
private[cli] def run(options: CliOptions): ExitCode = {
val termDisplayMessage =
if (options.testing) "Looking for unformatted files..."
else "Reformatting..."
if (options.debug) {
val pwd = options.common.workingDirectory.jfile.getPath
val out = options.info
out.println("Working directory: " + pwd)
}
// Run format using
// - `scalafmt-dynamic` if the specified `version` setting doesn't match build version.
// - `scalafmt-core` if the specified `version` setting match with build version
// (or if the `version` is not specified).
val runner: ScalafmtRunner = options.version match {
case None => ScalafmtCoreRunner
case Some(v) if v == Versions.version =>
ScalafmtCoreRunner
case _ => ScalafmtDynamicRunner
}
val exit = runner.run(options, termDisplayMessage)
if (options.testing) {
if (exit.isOk) {
options.common.out.println("All files are formatted with scalafmt :)")
} else if (exit.is(ExitCode.TestError)) {
options.common.out.println(
"error: --test failed"
)
options.onTestFailure.foreach(options.common.out.println)
} else {
options.common.out.println(s"error: $exit")
}
}
if (options.testing &&
!options.fatalWarnings &&
!exit.is(ExitCode.TestError)) {
// Ignore parse errors etc.
ExitCode.Ok
} else {
exit
}
}
}

View file

@ -1,190 +0,0 @@
package org.scalafmt.cli
import java.io.File
import java.util.Date
import org.scalafmt.Versions
import org.scalafmt.util.AbsoluteFile
import scopt.OptionParser
object CliArgParser {
val usageExamples: String =
"""|scalafmt # Format all files in the current project, configuration is determined in this order:
| # 1. .scalafmt.conf file in current directory
| # 2. .scalafmt.conf inside root directory of current git repo
| # 3. no configuration, default style
|scalafmt --test # throw exception on mis-formatted files, won't write to files.
|scalafmt --mode diff # Format all files that were edited in git diff against master branch.
|scalafmt --mode changed # Format files listed in `git status` (latest changes against previous commit.
|scalafmt --diff-branch 2.x # same as --diff, except against branch 2.x
|scalafmt --stdin # read from stdin and print to stdout
|scalafmt --stdin --assume-filename foo.sbt < foo.sbt # required when using --stdin to format .sbt files.
|scalafmt Code1.scala A.scala # write formatted contents to file.
|scalafmt --stdout Code.scala # print formatted contents to stdout.
|scalafmt --exclude target # format all files in directory excluding target
|scalafmt --config .scalafmt.conf # read custom style from file.
|scalafmt --config-str "style=IntelliJ" # define custom style as a flag, must be quoted.""".stripMargin
val scoptParser: OptionParser[CliOptions] =
new scopt.OptionParser[CliOptions]("scalafmt") {
override def showUsageOnError = false
private def printAndExit(
inludeUsage: Boolean
)(ignore: Unit, c: CliOptions): CliOptions = {
if (inludeUsage) showUsage
else showHeader
sys.exit
c
}
private def readConfig(contents: String, c: CliOptions): CliOptions = {
c.copy(configStr = Some(contents))
}
private def readConfigFromFile(
file: String,
c: CliOptions
): CliOptions = {
val configFile =
AbsoluteFile.fromFile(new File(file), c.common.workingDirectory)
c.copy(config = Some(configFile.jfile.toPath))
}
private def addFile(file: File, c: CliOptions): CliOptions = {
val absFile = AbsoluteFile.fromFile(file, c.common.workingDirectory)
c.copy(customFiles = c.customFiles :+ absFile)
}
head("scalafmt", Versions.nightly)
opt[Unit]('h', "help")
.action(printAndExit(inludeUsage = true))
.text("prints this usage text")
opt[Unit]('v', "version")
.action(printAndExit(inludeUsage = false))
.text("print version ")
arg[File]("<file>...")
.optional()
.unbounded()
.action((file, c) => addFile(file, c))
.text(
"file or directory, in which case all *.scala files are formatted."
)
opt[Seq[File]]('f', "files")
.action { (files, c) =>
c.copy(
customFiles =
AbsoluteFile.fromFiles(files, c.common.workingDirectory)
)
}
.hidden() // this option isn't needed anymore. Simply pass the files as
// arguments. Keeping for backwards compatibility
.text(
"file or directory, in which case all *.scala files are formatted. Deprecated: pass files as arguments"
)
opt[Unit]('i', "in-place")
.action((opt, c) => c.copy(writeMode = Override))
.hidden() // this option isn't needed anymore. Simply don't pass
// --stdout. Keeping for backwards compatibility
.text("format files in-place (default)")
opt[Unit]("stdout")
.action((opt, c) => c.copy(writeMode = Stdout))
.text("write formatted files to stdout")
opt[Boolean]("git")
.action((opt, c) => c.copy(git = Some(opt)))
.text("if true, ignore files in .gitignore (default false)")
opt[Seq[String]]("exclude")
.action((excludes, c) => c.copy(customExcludes = excludes))
.text(
"file or directory, in which case all *.scala files are formatted."
)
opt[String]('c', "config")
.action(readConfigFromFile)
.text("a file path to .scalafmt.conf.")
opt[String]("config-str")
.action(readConfig)
.text("configuration defined as a string")
opt[Unit]("stdin")
.action((_, c) => c.copy(stdIn = true))
.text("read from stdin and print to stdout")
opt[Unit]("no-stderr")
.action((_, c) => c.copy(noStdErr = true))
.text("don't use strerr for messages, output to stdout")
opt[String]("assume-filename")
.action((filename, c) => c.copy(assumeFilename = filename))
.text(
"when using --stdin, use --assume-filename to hint to scalafmt that the input is an .sbt file."
)
opt[Unit]("test")
.action((_, c) => c.copy(testing = true))
.text("test for mis-formatted code, exits with status 1 on failure.")
opt[File]("migrate2hocon")
.action(
(file, c) =>
c.copy(
migrate =
Some(AbsoluteFile.fromFile(file, c.common.workingDirectory))
)
)
.text(
"""migrate .scalafmt CLI style configuration to hocon style configuration in .scalafmt.conf"""
)
opt[Unit]("diff")
.action((_, c) => c.copy(mode = Option(DiffFiles("master"))))
.text(
s"""Format files listed in `git diff` against master.
|Deprecated: use --mode diff instead""".stripMargin
)
opt[FileFetchMode]("mode")
.action((m, c) => c.copy(mode = Option(m)))
.text(
s"""Sets the files to be formatted fetching mode.
|Options:
| diff - format files listed in `git diff` against master
| changed - format files listed in `git status` (latest changes against previous commit)""".stripMargin
)
opt[String]("diff-branch")
.action((branch, c) => c.copy(diff = Some(branch)))
.text(
"If set, only format edited files in git diff against provided branch. Has no effect if mode set to `changed`."
)
opt[Unit]("build-info")
.action({
case (_, c) =>
println(buildInfo)
sys.exit
})
.text("prints build information")
opt[Unit]("quiet")
.action((_, c) => c.copy(quiet = true))
.text("don't print out stuff to console.")
opt[Unit]("debug")
.action((_, c) => c.copy(debug = true))
.text("print out diagnostics to console.")
opt[Unit]("non-interactive")
.action((_, c) => c.copy(nonInteractive = true))
.text("disable fancy progress bar, useful in ci or sbt plugin.")
opt[(Int, Int)]("range")
.hidden()
.action({
case ((from, to), c) =>
val offset = if (from == to) 0 else -1
c.copy(range = c.range + Range(from - 1, to + offset))
})
.text("(experimental) only format line range from=to")
note(s"""|Examples:
|$usageExamples
|Please file bugs to https://github.com/scalameta/scalafmt/issues
""".stripMargin)
}
def buildInfo =
s"""build commit: ${Versions.commit}
|build time: ${new Date(Versions.timestamp.toLong)}""".stripMargin
}

View file

@ -1,275 +0,0 @@
package org.scalafmt.cli
import java.io.{IOException, InputStream, PrintStream}
import java.nio.charset.UnsupportedCharsetException
import java.nio.file.{Files, Path}
import com.typesafe.config.{ConfigException, ConfigFactory}
import metaconfig.Configured
import org.scalafmt.config.ScalafmtConfig
import org.scalafmt.config.Config
import org.scalafmt.util.{AbsoluteFile, FileOps, GitOps, GitOpsImpl, OsSpecific}
import scala.io.Codec
import scala.util.control.NonFatal
import scala.util.matching.Regex
import scala.util.control.Exception.catching
object CliOptions {
val default = CliOptions()
/**
* Tries to read configuration from
*
* 1. .scalafmt.conf in root dir of current git repo
* IF the following setting is enabled: project.git = true
* 2. .scalafmt.conf from init.commong.workingDirectory
*
* I am happy to add alternative fallback methods for other VCS.
*
* WARNING. Throws an exception if the .scalafmt.conf error exists but
* contains an error. Why? Because this method is only supposed to be
* called directly from main.
*/
def auto(args: Array[String], init: CliOptions)(
parsed: CliOptions
): CliOptions = {
val style: Option[Path] = if (init.config != parsed.config) {
parsed.config
} else {
tryCurrentDirectory(parsed).orElse(tryGit(parsed))
}
val newMode = if (parsed.testing) Stdout else parsed.writeMode
parsed.copy(
writeMode = newMode,
config = style
)
}
private def getConfigJFile(file: AbsoluteFile): AbsoluteFile =
file / ".scalafmt.conf"
private def tryDirectory(options: CliOptions)(dir: AbsoluteFile): Path =
getConfigJFile(dir).jfile.toPath
private def tryGit(options: CliOptions): Option[Path] = {
for {
rootDir <- options.gitOps.rootDir
path = tryDirectory(options)(rootDir)
configFilePath <- if (path.toFile.isFile) Some(path) else None
} yield configFilePath
}
private def tryCurrentDirectory(options: CliOptions): Option[Path] = {
val configFilePath = tryDirectory(options)(options.common.workingDirectory)
if (configFilePath.toFile.isFile) Some(configFilePath) else None
}
}
case class CommonOptions(
workingDirectory: AbsoluteFile = AbsoluteFile.userDir,
out: PrintStream = System.out,
in: InputStream = System.in,
err: PrintStream = System.err
)
case class CliOptions(
config: Option[Path] = None,
configStr: Option[String] = None,
range: Set[Range] = Set.empty[Range],
customFiles: Seq[AbsoluteFile] = Nil,
customExcludes: Seq[String] = Nil,
writeMode: WriteMode = Override,
testing: Boolean = false,
stdIn: Boolean = false,
quiet: Boolean = false,
debug: Boolean = false,
git: Option[Boolean] = None,
nonInteractive: Boolean = false,
mode: Option[FileFetchMode] = None,
diff: Option[String] = None,
assumeFilename: String = "stdin.scala", // used when read from stdin
migrate: Option[AbsoluteFile] = None,
common: CommonOptions = CommonOptions(),
gitOpsConstructor: AbsoluteFile => GitOps = x => new GitOpsImpl(x),
noStdErr: Boolean = false
) {
// These default values are copied from here.
// https://github.com/scalameta/scalafmt/blob/f2154330afa0bc4a0a556598adeb116eafecb8e3/scalafmt-core/shared/src/main/scala/org/scalafmt/config/ScalafmtConfig.scala#L127-L162
private[this] val DefaultGit = false
private[this] val DefaultFatalWarnings = false
private[this] val DefaultIgnoreWarnings = false
private[this] val DefaultEncoding = Codec.UTF8
/** Create a temporary file that contains configuration string specified by `--config-str`.
* This temporary file will be passed to `scalafmt-dynamic`.
* See https://github.com/scalameta/scalafmt/pull/1367#issuecomment-464744077
*/
private[this] val tempConfigPath: Option[Path] = configStr.map { s =>
val file = Files.createTempFile(".scalafmt", ".conf")
Files.write(file, s.getBytes)
file
}
/** - If --config-str is specified (and tempConfigPath is defined),
* this returns the path to a temporary file.
* - If both tempConfigPath and config are None,
* this return the path to `.scalafmt.conf` on the working directory.
*
* @return A path to a configuration file
*/
def configPath: Path = tempConfigPath match {
case Some(tempConf) => tempConf
case None =>
config.getOrElse(
(common.workingDirectory / ".scalafmt.conf").jfile.toPath
)
}
/** Parse the scalafmt configuration and try to encode it to `ScalafmtConfig`.
* If `--config-str` is specified, this will parse the configuration string specified by `--config-str`.
* Otherwise, a contents of configuration file specified by `configPath` will be parsed.
*
* If `--config-str` is not specified and configuration file is missing, this will return the default configuration
*/
def scalafmtConfig: Configured[ScalafmtConfig] = {
(configStr match {
case Some(contents) => Some(contents)
case None =>
val file =
AbsoluteFile.fromFile(configPath.toFile, common.workingDirectory)
catching(classOf[IOException]).opt(FileOps.readFile(file))
}).map { content =>
Config.fromHoconString(content)
}
.getOrElse(Configured.Ok(ScalafmtConfig.default))
}
val inPlace: Boolean = writeMode == Override
val fileFetchMode: FileFetchMode =
mode.orElse(Some(GitFiles).filter(_ => isGit)).getOrElse(RecursiveSearch)
val files: Seq[AbsoluteFile] =
if (customFiles.isEmpty)
Seq(common.workingDirectory)
else
customFiles
val gitOps: GitOps = gitOpsConstructor(common.workingDirectory)
/*
def withProject(projectFiles: ProjectFiles): CliOptions = {
this.copy(config = config.copy(project = projectFiles))
}
*/
def withFiles(files: Seq[AbsoluteFile]): CliOptions = {
this.copy(customFiles = files)
}
def info: PrintStream = {
if (noStdErr || (!stdIn && writeMode != Stdout)) common.out else common.err
}
def excludeFilterRegexp: Regex =
mkRegexp(customExcludes.map(OsSpecific.fixSeparatorsInPathPattern))
private def mkRegexp(filters: Seq[String], strict: Boolean = false): Regex =
filters match {
case Nil => "$a".r // will never match anything
case head :: Nil => head.r
case _ if strict => filters.mkString("^(", "|", ")$").r
case _ => filters.mkString("(", "|", ")").r
}
private[cli] def isGit: Boolean = readGit(configPath).getOrElse(DefaultGit)
private[cli] def fatalWarnings: Boolean =
readFatalWarnings(configPath).getOrElse(DefaultFatalWarnings)
private[cli] def ignoreWarnings: Boolean =
readIgnoreWarnings(configPath).getOrElse(DefaultIgnoreWarnings)
private[cli] def onTestFailure: Option[String] = readOnTestFailure(configPath)
private[cli] def encoding: Codec =
readEncoding(configPath).getOrElse(DefaultEncoding)
/** Returns None if .scalafmt.conf is not found or
* version setting is missing.
*/
private[cli] def version: Option[String] =
readVersion(configPath)
private def readGit(config: Path): Option[Boolean] = {
try {
Some(
ConfigFactory
.parseFile(config.toFile)
.getConfig("project")
.getBoolean("git")
)
} catch {
case _: ConfigException.Missing => None
case NonFatal(_) => None
}
}
private def readOnTestFailure(config: Path): Option[String] = {
try {
Some(ConfigFactory.parseFile(config.toFile).getString("onTestFailure"))
} catch {
case _: ConfigException.Missing => None
case NonFatal(_) => None
}
}
private def readFatalWarnings(config: Path): Option[Boolean] = {
try {
Some(
ConfigFactory
.parseFile(config.toFile)
.getConfig("runner")
.getBoolean("fatalWarnings")
)
} catch {
case _: ConfigException.Missing => None
case NonFatal(_) => None
}
}
private def readIgnoreWarnings(config: Path): Option[Boolean] = {
try {
Some(
ConfigFactory
.parseFile(config.toFile)
.atPath("runner")
.getBoolean("ignoreWarnings")
)
} catch {
case _: ConfigException.Missing => None
case NonFatal(_) => None
}
}
private def readEncoding(config: Path): Option[Codec] = {
try {
val codecStr =
ConfigFactory.parseFile(config.toFile).getString("encoding")
Some(Codec.apply(codecStr))
} catch {
case _: ConfigException.Missing => None
case _: UnsupportedCharsetException => None
case NonFatal(_) => None
}
}
private def readVersion(config: Path): Option[String] = {
try {
Some(ConfigFactory.parseFile(config.toFile).getString("version"))
} catch {
case _: ConfigException.Missing => None
case NonFatal(_) => None
}
}
}

View file

@ -1,56 +0,0 @@
package org.scalafmt.cli
import scala.collection.mutable
sealed abstract case class ExitCode(code: Int, name: String) {
def isOk: Boolean = this == ExitCode.Ok
def is(c: ExitCode): Boolean =
(code & c.code) != 0
override def toString: String = s"$name=$code"
}
object ExitCode {
// NOTE: ExitCode resembles an Enumeration very much, but has minor differences
// for example how the name is calculated for merged exit codes.
private var counter = 0
private val allInternal = mutable.ListBuffer.empty[ExitCode]
private val cache =
new java.util.concurrent.ConcurrentHashMap[Int, ExitCode]
private def generateExitStatus(implicit name: sourcecode.Name) = {
val code = counter
counter = if (counter == 0) 1 else counter << 1
val result = new ExitCode(code, name.value) {}
allInternal += result
result
}
// see https://github.com/scalameta/scalafmt/issues/941
// format: off
val Ok,
TestError,
ParseError,
CommandLineArgumentError,
UnexpectedError
: ExitCode = generateExitStatus
// format: on
lazy val all: List[ExitCode] = allInternal.toList
private def codeToName(code: Int): String = {
if (code == 0) Ok.name
else {
val names = all.collect {
case exit if (exit.code & code) != 0 => exit.name
}
names.mkString("+")
}
}
def apply(code: Int): ExitCode = {
if (cache.contains(code)) cache.get(code)
else {
val result = new ExitCode(code, codeToName(code)) {}
cache.put(code, result)
result
}
}
def merge(exit1: ExitCode, exit2: ExitCode): ExitCode =
apply(exit1.code | exit2.code)
}

View file

@ -1,532 +0,0 @@
package org.scalafmt.cli
/**
* This code is copy/pasted from (Apache 2 licence)
* https://github.com/alexarchambault/coursier/blob/51fefe5c29d95752ce487f60d333b1f8a91dd1b0/cache/src/main/scala/coursier/TermDisplay.scala
*
* which in turn was copy/pasted from (MIT licence)
* https://github.com/lihaoyi/Ammonite/blob/10854e3b8b454a74198058ba258734a17af32023/terminal/src/main/scala/ammonite/terminal/Utils.scala
*/
import scala.annotation.tailrec
import scala.collection.mutable.ArrayBuffer
import scala.util.Try
import java.io.File
import java.io.Writer
import java.sql.Timestamp
import java.util.concurrent._
object Terminal {
private lazy val pathedTput =
if (new File("/usr/bin/tput").exists()) "/usr/bin/tput" else "tput"
def consoleDim(s: String): Option[Int] =
if (new File("/dev/tty").exists()) {
import sys.process._
val nullLog = new ProcessLogger {
def out(s: => String): Unit = {}
def err(s: => String): Unit = {}
def buffer[T](f: => T): T = f
}
Try(
Process(Seq("bash", "-c", s"$pathedTput $s 2> /dev/tty"))
.!!(nullLog)
.trim
.toInt
).toOption
} else
None
implicit class Ansi(val output: Writer) extends AnyVal {
private def control(n: Int, c: Char) = output.write(s"\033[" + n + c)
/**
* Move up `n` squares
*/
def up(n: Int): Unit = if (n > 0) control(n, 'A')
/**
* Move down `n` squares
*/
def down(n: Int): Unit = if (n > 0) control(n, 'B')
/**
* Move left `n` squares
*/
def left(n: Int): Unit = if (n > 0) control(n, 'D')
/**
* Clear the current line
*
* n=0: clear from cursor to end of line
* n=1: clear from cursor to start of line
* n=2: clear entire line
*/
def clearLine(n: Int): Unit = control(n, 'K')
}
}
object TermDisplay {
def defaultFallbackMode: Boolean = {
val env0 = sys.env.get("COURSIER_PROGRESS").map(_.toLowerCase).collect {
case "true" | "enable" | "1" => true
case "false" | "disable" | "0" => false
}
def compatibilityEnv = sys.env.get("COURSIER_NO_TERM").nonEmpty
def nonInteractive = System.console() == null
def insideEmacs = sys.env.contains("INSIDE_EMACS")
def ci = sys.env.contains("CI")
val env = env0.getOrElse(compatibilityEnv)
env || nonInteractive || insideEmacs || ci
}
private sealed abstract class Info extends Product with Serializable {
def fraction: Option[Double]
def display(): String
}
private case class DownloadInfo(
downloaded: Long,
previouslyDownloaded: Long,
length: Option[Long],
startTime: Long,
updateCheck: Boolean
) extends Info {
/** 0.0 to 1.0 */
def fraction: Option[Double] = length.map(downloaded.toDouble / _)
/** Byte / s */
def rate(): Option[Double] = {
val currentTime = System.currentTimeMillis()
if (currentTime > startTime)
Some(
(downloaded - previouslyDownloaded).toDouble /
(System.currentTimeMillis() - startTime) * 1000.0
)
else
None
}
// Scala version of http://stackoverflow.com/questions/3758606/how-to-convert-byte-size-into-human-readable-format-in-java/3758880#3758880
private def byteCount(bytes: Long, si: Boolean = false): String = {
val unit = if (si) 1000 else 1024
if (bytes < unit)
bytes + " B"
else {
val exp = (math.log(bytes) / math.log(unit)).toInt
val pre =
(if (si) "kMGTPE"
else "KMGTPE").charAt(exp - 1) +
(if (si) ""
else "i")
f"${bytes / math.pow(unit, exp)}%.1f ${pre}B"
}
}
def display(): String = {
val decile = (10.0 * fraction.getOrElse(0.0)).toInt
assert(decile >= 0)
assert(decile <= 10)
fraction.fold(" " * 6)(p => f"${100.0 * p}%5.1f%%") +
" [" + ("#" * decile) + (" " * (10 - decile)) + "] " +
downloaded + " source files formatted"
}
}
private val format = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss")
private def formatTimestamp(ts: Long): String =
format.format(new Timestamp(ts))
private case class CheckUpdateInfo(
currentTimeOpt: Option[Long],
remoteTimeOpt: Option[Long],
isDone: Boolean
) extends Info {
def fraction = None
def display(): String = {
if (isDone)
(currentTimeOpt, remoteTimeOpt) match {
case (Some(current), Some(remote)) =>
if (current < remote)
s"Updated since ${formatTimestamp(current)} (${formatTimestamp(remote)})"
else if (current == remote)
s"No new update since ${formatTimestamp(current)}"
else
s"Warning: local copy newer than remote one (${formatTimestamp(current)} > ${formatTimestamp(remote)})"
case (Some(_), None) =>
// FIXME Likely a 404 Not found, that should be taken into account by the cache
"No modified time in response"
case (None, Some(remote)) =>
s"Last update: ${formatTimestamp(remote)}"
case (None, None) =>
"" // ???
} else
currentTimeOpt match {
case Some(current) =>
s"Checking for updates since ${formatTimestamp(current)}"
case None =>
"" // ???
}
}
}
private sealed abstract class Message extends Product with Serializable
private object Message {
case object Update extends Message
case object Stop extends Message
}
private val refreshInterval = 1000 / 60
private val fallbackRefreshInterval = 1000
private class UpdateDisplayThread(
out: Writer,
var fallbackMode: Boolean
) extends Thread("TermDisplay") {
import Terminal.Ansi
setDaemon(true)
private var width = 80
private var currentHeight = 0
private val q = new LinkedBlockingDeque[Message]
def update(): Unit = {
if (q.size() == 0)
q.put(Message.Update)
}
def end(): Unit = {
q.put(Message.Stop)
join()
}
private val downloads = new ArrayBuffer[String]
private val doneQueue = new ArrayBuffer[(String, Info)]
val infos = new ConcurrentHashMap[String, Info]
def newEntry(
url: String,
info: Info,
fallbackMessage: => String
): Unit = {
assert(!infos.containsKey(url))
val prev = infos.putIfAbsent(url, info)
assert(prev == null)
if (fallbackMode) {
// FIXME What about concurrent accesses to out from the thread above?
out.write(fallbackMessage)
out.flush()
}
downloads.synchronized {
downloads.append(url)
}
update()
}
def removeEntry(
url: String,
success: Boolean,
fallbackMessage: => String
)(
update0: Info => Info
): Unit = {
downloads.synchronized {
downloads -= url
val info = infos.remove(url)
if (success)
doneQueue += (url -> update0(info))
}
if (fallbackMode && success) {
// FIXME What about concurrent accesses to out from the thread above?
out.write(fallbackMessage)
out.flush()
}
update()
}
private def reflowed(url: String, info: Info) = {
val extra = info match {
case downloadInfo: DownloadInfo =>
val pctOpt = downloadInfo.fraction.map(100.0 * _)
if (downloadInfo.length.isEmpty && downloadInfo.downloaded == 0L)
""
else {
val pctOptStr =
pctOpt.map(pct => f"$pct%.2f %%, ").toIterable.mkString
val downloadInfoStr = downloadInfo.length.map(" / " + _).mkString
s"($pctOptStr${downloadInfo.downloaded}$downloadInfoStr)"
}
case updateInfo: CheckUpdateInfo =>
"Checking for updates"
}
val baseExtraWidth = width / 5
val total = url.length + 1 + extra.length
val (url0, extra0) =
if (total >= width) { // or > ? If equal, does it go down 2 lines?
val overflow = total - width + 1
val extra0 =
if (extra.length > baseExtraWidth)
extra.take((baseExtraWidth max (extra.length - overflow)) - 1) + "…"
else
extra
val total0 = url.length + 1 + extra0.length
val overflow0 = total0 - width + 1
val url0 =
if (total0 >= width)
url.take(
((width - baseExtraWidth - 1) max (url.length - overflow0)) - 1
) + "…"
else
url
(url0, extra0)
} else
(url, extra)
(url0, extra0)
}
private def truncatedPrintln(s: String): Unit = {
out.clearLine(2)
if (s.length <= width)
out.write(s + "\n")
else
out.write(s.take(width - 1) + "…\n")
}
@tailrec private def updateDisplayLoop(lineCount: Int): Unit = {
currentHeight = lineCount
Option(q.poll(100L, TimeUnit.MILLISECONDS)) match {
case None => updateDisplayLoop(lineCount)
case Some(Message.Stop) => // poison pill
case Some(Message.Update) =>
val (done0, downloads0) = downloads.synchronized {
val q = doneQueue.toVector
.filter {
case (url, _) =>
!url.endsWith(".sha1") && !url.endsWith(".md5")
}
.sortBy { case (url, _) => url }
doneQueue.clear()
val dw = downloads.toVector
.map { url =>
url -> infos.get(url)
}
.sortBy { case (_, info) => -info.fraction.sum }
(q, dw)
}
for ((url, info) <- done0 ++ downloads0) {
assert(info != null, s"Incoherent state ($url)")
truncatedPrintln(url)
out.clearLine(2)
out.write(s" ${info.display()}\n")
}
val displayedCount = (done0 ++ downloads0).length
if (displayedCount < lineCount) {
for (_ <- 1 to 2; _ <- displayedCount until lineCount) {
out.clearLine(2)
out.down(1)
}
for (_ <- displayedCount until lineCount)
out.up(2)
}
for (_ <- downloads0.indices)
out.up(2)
out.left(10000)
out.flush()
Thread.sleep(refreshInterval)
updateDisplayLoop(downloads0.length)
}
}
@tailrec private def fallbackDisplayLoop(previous: Set[String]): Unit =
Option(q.poll(100L, TimeUnit.MILLISECONDS)) match {
case None => fallbackDisplayLoop(previous)
case Some(Message.Stop) => // poison pill
// clean up display
for (_ <- 1 to 2; _ <- 0 until currentHeight) {
out.clearLine(2)
out.down(1)
}
for (_ <- 0 until currentHeight) {
out.up(2)
}
case Some(Message.Update) =>
val downloads0 = downloads.synchronized {
downloads.toVector
.map { url =>
url -> infos.get(url)
}
.sortBy { case (_, info) => -info.fraction.sum }
}
var displayedSomething = false
for ((url, info) <- downloads0 if previous(url)) {
assert(info != null, s"Incoherent state ($url)")
val (url0, extra0) = reflowed(url, info)
displayedSomething = true
out.write(s"$url0 $extra0\n")
}
if (displayedSomething)
out.write("\n")
out.flush()
Thread.sleep(fallbackRefreshInterval)
fallbackDisplayLoop(previous ++ downloads0.map {
case (url, _) => url
})
}
override def run(): Unit = {
Terminal.consoleDim("cols") match {
case Some(cols) =>
width = cols
out.clearLine(2)
case None =>
fallbackMode = true
}
if (fallbackMode)
fallbackDisplayLoop(Set.empty)
else
updateDisplayLoop(0)
}
}
}
object Cache {
trait Logger {
def foundLocally(url: String, f: File): Unit = {}
def startTask(url: String, file: File): Unit = {}
def taskProgress(url: String, downloaded: Long): Unit = {}
def completedTask(url: String, success: Boolean): Unit = {}
def checkingUpdates(url: String, currentTimeOpt: Option[Long]): Unit = {}
}
}
class TermDisplay(
out: Writer,
val fallbackMode: Boolean = TermDisplay.defaultFallbackMode
) extends Cache.Logger {
import TermDisplay._
private val updateThread = new UpdateDisplayThread(out, fallbackMode)
def init(): Unit = {
updateThread.start()
}
def stop(): Unit = {
updateThread.end()
}
override def startTask(msg: String, file: File): Unit =
updateThread.newEntry(
msg,
DownloadInfo(
0L,
0L,
None,
System.currentTimeMillis(),
updateCheck = false
),
s"$msg\n"
)
def taskLength(
url: String,
totalLength: Long,
alreadyDownloaded: Long
): Unit = {
val info = updateThread.infos.get(url)
assert(info != null)
val newInfo = info match {
case info0: DownloadInfo =>
info0.copy(
length = Some(totalLength),
previouslyDownloaded = alreadyDownloaded
)
case _ =>
throw new Exception(s"Incoherent display state for $url")
}
updateThread.infos.put(url, newInfo)
updateThread.update()
}
override def taskProgress(url: String, downloaded: Long): Unit = {
val info = updateThread.infos.get(url)
if (info != null) { // We might not want the progress bar.
val newInfo = info match {
case info0: DownloadInfo =>
info0.copy(downloaded = downloaded)
case _ =>
throw new Exception(s"Incoherent display state for $url")
}
updateThread.infos.put(url, newInfo)
updateThread.update()
}
}
override def completedTask(url: String, success: Boolean): Unit =
updateThread.removeEntry(url, success, s"$url\n")(x => x)
override def checkingUpdates(
url: String,
currentTimeOpt: Option[Long]
): Unit =
updateThread.newEntry(
url,
CheckUpdateInfo(currentTimeOpt, None, isDone = false),
s"$url\n"
)
}

View file

@ -148,6 +148,7 @@ public class TupleBase<E> {
* *
* @deprecated replaced by {@link #getTupleOutput} * @deprecated replaced by {@link #getTupleOutput}
*/ */
@Deprecated
public static TupleOutput newOutput() { public static TupleOutput newOutput() {
return new TupleOutput(); return new TupleOutput();
@ -163,6 +164,7 @@ public class TupleBase<E> {
* *
* @deprecated replaced by {@link #getTupleOutput} * @deprecated replaced by {@link #getTupleOutput}
*/ */
@Deprecated
public static TupleOutput newOutput(byte[] buffer) { public static TupleOutput newOutput(byte[] buffer) {
return new TupleOutput(buffer); return new TupleOutput(buffer);

View file

@ -76,6 +76,7 @@ public class BtreeStats extends DatabaseStats {
/** /**
* @deprecated as of 5.0, returns zero. * @deprecated as of 5.0, returns zero.
*/ */
@Deprecated
public long getDuplicateBottomInternalNodeCount() { public long getDuplicateBottomInternalNodeCount() {
return 0; return 0;
} }
@ -99,6 +100,7 @@ public class BtreeStats extends DatabaseStats {
/** /**
* @deprecated as of 5.0, returns zero. * @deprecated as of 5.0, returns zero.
*/ */
@Deprecated
public long getDupCountLeafNodeCount() { public long getDupCountLeafNodeCount() {
return 0; return 0;
} }
@ -120,6 +122,7 @@ public class BtreeStats extends DatabaseStats {
/** /**
* @deprecated as of 5.0, returns zero. * @deprecated as of 5.0, returns zero.
*/ */
@Deprecated
public long getDuplicateInternalNodeCount() { public long getDuplicateInternalNodeCount() {
return 0; return 0;
} }
@ -161,6 +164,7 @@ public class BtreeStats extends DatabaseStats {
/** /**
* @deprecated as of 5.0, returns zero. * @deprecated as of 5.0, returns zero.
*/ */
@Deprecated
public int getDuplicateTreeMaxDepth() { public int getDuplicateTreeMaxDepth() {
return 0; return 0;
} }
@ -216,6 +220,7 @@ public class BtreeStats extends DatabaseStats {
/** /**
* @deprecated as of 5.0, returns an empty array. * @deprecated as of 5.0, returns an empty array.
*/ */
@Deprecated
public long[] getDINsByLevel() { public long[] getDINsByLevel() {
return new long[0]; return new long[0];
} }
@ -223,6 +228,7 @@ public class BtreeStats extends DatabaseStats {
/** /**
* @deprecated as of 5.0, returns an empty array. * @deprecated as of 5.0, returns an empty array.
*/ */
@Deprecated
public long[] getDBINsByLevel() { public long[] getDBINsByLevel() {
return new long[0]; return new long[0];
} }

View file

@ -173,6 +173,7 @@ public enum CacheMode {
* @deprecated please use {@link #DEFAULT} instead. As of JE 4.0, this mode * @deprecated please use {@link #DEFAULT} instead. As of JE 4.0, this mode
* functions exactly as if {@link #DEFAULT} were specified. * functions exactly as if {@link #DEFAULT} were specified.
*/ */
@Deprecated
KEEP_HOT, KEEP_HOT,
/** /**
@ -247,6 +248,7 @@ public enum CacheMode {
* @deprecated please use {@link #UNCHANGED} instead. As of JE 4.0, this * @deprecated please use {@link #UNCHANGED} instead. As of JE 4.0, this
* mode functions exactly as if {@link #UNCHANGED} were specified. * mode functions exactly as if {@link #UNCHANGED} were specified.
*/ */
@Deprecated
MAKE_COLD, MAKE_COLD,
/** /**

View file

@ -1000,6 +1000,7 @@ public class Database implements Closeable {
* @deprecated in favor of {@link #populateSecondaries(Transaction, * @deprecated in favor of {@link #populateSecondaries(Transaction,
* DatabaseEntry, DatabaseEntry, long, CacheMode)}. * DatabaseEntry, DatabaseEntry, long, CacheMode)}.
*/ */
@Deprecated
public void populateSecondaries(final Transaction txn, public void populateSecondaries(final Transaction txn,
final DatabaseEntry key, final DatabaseEntry key,
final DatabaseEntry data) { final DatabaseEntry data) {
@ -1868,6 +1869,7 @@ public class Database implements Closeable {
* *
* @throws IllegalStateException if the database has been closed. * @throws IllegalStateException if the database has been closed.
*/ */
@Deprecated
public void preload(final long maxBytes) { public void preload(final long maxBytes) {
checkEnv(); checkEnv();
final DatabaseImpl dbImpl = checkOpen(); final DatabaseImpl dbImpl = checkOpen();
@ -1908,6 +1910,7 @@ public class Database implements Closeable {
* *
* @throws IllegalStateException if the database has been closed. * @throws IllegalStateException if the database has been closed.
*/ */
@Deprecated
public void preload(final long maxBytes, final long maxMillisecs) { public void preload(final long maxBytes, final long maxMillisecs) {
checkEnv(); checkEnv();
final DatabaseImpl dbImpl = checkOpen(); final DatabaseImpl dbImpl = checkOpen();

View file

@ -437,6 +437,7 @@ public class DatabaseConfig implements Cloneable {
* @deprecated this property no longer has any effect; {@link * @deprecated this property no longer has any effect; {@link
* #setNodeMaxEntries} should be used instead. * #setNodeMaxEntries} should be used instead.
*/ */
@Deprecated
public DatabaseConfig setNodeMaxDupTreeEntries(int nodeMaxDupTreeEntries) { public DatabaseConfig setNodeMaxDupTreeEntries(int nodeMaxDupTreeEntries) {
return this; return this;
} }
@ -464,6 +465,7 @@ public class DatabaseConfig implements Cloneable {
* @deprecated this property no longer has any effect and zero is always * @deprecated this property no longer has any effect and zero is always
* returned; {@link #getNodeMaxEntries} should be used instead. * returned; {@link #getNodeMaxEntries} should be used instead.
*/ */
@Deprecated
public int getNodeMaxDupTreeEntries() { public int getNodeMaxDupTreeEntries() {
return 0; return 0;
} }
@ -1375,6 +1377,7 @@ public class DatabaseConfig implements Cloneable {
* @deprecated As of JE 4.0.13, replaced by {@link * @deprecated As of JE 4.0.13, replaced by {@link
* DatabaseConfig#clone()}.</p> * DatabaseConfig#clone()}.</p>
*/ */
@Deprecated
public DatabaseConfig cloneConfig() { public DatabaseConfig cloneConfig() {
return clone(); return clone();
} }

View file

@ -291,6 +291,7 @@ public class DbInternal {
/** /**
* @deprecated use new-style API below instead. * @deprecated use new-style API below instead.
*/ */
@Deprecated
public static OperationStatus search( public static OperationStatus search(
final Cursor cursor, final Cursor cursor,
final DatabaseEntry key, final DatabaseEntry key,
@ -374,6 +375,7 @@ public class DbInternal {
/** /**
* @deprecated use new-style API below instead. * @deprecated use new-style API below instead.
*/ */
@Deprecated
public static OperationStatus searchBoth( public static OperationStatus searchBoth(
final Cursor cursor, final Cursor cursor,
final DatabaseEntry key, final DatabaseEntry key,
@ -494,6 +496,7 @@ public class DbInternal {
/** /**
* @deprecated use {@link CursorConfig#setNonSticky} instead. * @deprecated use {@link CursorConfig#setNonSticky} instead.
*/ */
@Deprecated
public static void setNonCloning(final Cursor cursor, public static void setNonCloning(final Cursor cursor,
final boolean nonSticky) { final boolean nonSticky) {
cursor.setNonSticky(nonSticky); cursor.setNonSticky(nonSticky);

View file

@ -262,6 +262,7 @@ public class DiskOrderedCursorConfig implements Cloneable {
* @deprecated this method has no effect and will be removed in a future * @deprecated this method has no effect and will be removed in a future
* release. * release.
*/ */
@Deprecated
public DiskOrderedCursorConfig setMaxSeedMillisecs( public DiskOrderedCursorConfig setMaxSeedMillisecs(
final long maxSeedMillisecs) { final long maxSeedMillisecs) {
return this; return this;
@ -278,6 +279,7 @@ public class DiskOrderedCursorConfig implements Cloneable {
* @deprecated this method returns zero and will be removed in a future * @deprecated this method returns zero and will be removed in a future
* release. * release.
*/ */
@Deprecated
public long getMaxSeedMillisecs() { public long getMaxSeedMillisecs() {
return 0; return 0;
} }
@ -286,6 +288,7 @@ public class DiskOrderedCursorConfig implements Cloneable {
* @deprecated this method has no effect and will be removed in a future * @deprecated this method has no effect and will be removed in a future
* release. * release.
*/ */
@Deprecated
public DiskOrderedCursorConfig setMaxSeedNodes(final long maxSeedNodes) { public DiskOrderedCursorConfig setMaxSeedNodes(final long maxSeedNodes) {
return this; return this;
} }
@ -301,6 +304,7 @@ public class DiskOrderedCursorConfig implements Cloneable {
* @deprecated this method returns zero and will be removed in a future * @deprecated this method returns zero and will be removed in a future
* release. * release.
*/ */
@Deprecated
public long getMaxSeedNodes() { public long getMaxSeedNodes() {
return 0; return 0;
} }

View file

@ -78,6 +78,7 @@ public class Durability {
* *
* @deprecated use {@link TransactionConfig#setReadOnly} instead. * @deprecated use {@link TransactionConfig#setReadOnly} instead.
*/ */
@Deprecated
public static final Durability READ_ONLY_TXN = public static final Durability READ_ONLY_TXN =
new Durability(SyncPolicy.NO_SYNC, // localSync new Durability(SyncPolicy.NO_SYNC, // localSync
SyncPolicy.NO_SYNC, // replicaSync SyncPolicy.NO_SYNC, // replicaSync

View file

@ -2185,6 +2185,7 @@ public class Environment implements Closeable {
* @deprecated as of 4.0.10, replaced by {@link * @deprecated as of 4.0.10, replaced by {@link
* Environment#getStats(StatsConfig)}.</p> * Environment#getStats(StatsConfig)}.</p>
*/ */
@Deprecated
public LockStats getLockStats(StatsConfig config) public LockStats getLockStats(StatsConfig config)
throws DatabaseException { throws DatabaseException {

View file

@ -1454,6 +1454,7 @@ public class EnvironmentConfig extends EnvironmentMutableConfig {
* beyond that of a simple RAID configuration, and will be removed in the * beyond that of a simple RAID configuration, and will be removed in the
* next release, which is slated for mid-April, 2017. * next release, which is slated for mid-April, 2017.
*/ */
@Deprecated
public static final String LOG_N_DATA_DIRECTORIES = public static final String LOG_N_DATA_DIRECTORIES =
"je.log.nDataDirectories"; "je.log.nDataDirectories";
@ -1793,6 +1794,7 @@ public class EnvironmentConfig extends EnvironmentMutableConfig {
* @deprecated NIO is no longer used by JE and this parameter has no * @deprecated NIO is no longer used by JE and this parameter has no
* effect. * effect.
*/ */
@Deprecated
public static final String LOG_USE_NIO = "je.log.useNIO"; public static final String LOG_USE_NIO = "je.log.useNIO";
/** /**
@ -1833,12 +1835,14 @@ public class EnvironmentConfig extends EnvironmentMutableConfig {
* @deprecated NIO is no longer used by JE and this parameter has no * @deprecated NIO is no longer used by JE and this parameter has no
* effect. * effect.
*/ */
@Deprecated
public static final String LOG_DIRECT_NIO = "je.log.directNIO"; public static final String LOG_DIRECT_NIO = "je.log.directNIO";
/** /**
* @deprecated NIO is no longer used by JE and this parameter has no * @deprecated NIO is no longer used by JE and this parameter has no
* effect. * effect.
*/ */
@Deprecated
public static final String LOG_CHUNKED_NIO = "je.log.chunkedNIO"; public static final String LOG_CHUNKED_NIO = "je.log.chunkedNIO";
/** /**
@ -2165,6 +2169,7 @@ public class EnvironmentConfig extends EnvironmentMutableConfig {
* @deprecated this property no longer has any effect; {@link * @deprecated this property no longer has any effect; {@link
* DatabaseConfig#setNodeMaxEntries} should be used instead. * DatabaseConfig#setNodeMaxEntries} should be used instead.
*/ */
@Deprecated
public static final String NODE_DUP_TREE_MAX_ENTRIES = public static final String NODE_DUP_TREE_MAX_ENTRIES =
"je.nodeDupTreeMaxEntries"; "je.nodeDupTreeMaxEntries";
@ -2245,6 +2250,7 @@ public class EnvironmentConfig extends EnvironmentMutableConfig {
* @deprecated as of JE 6.0. The {@link #TREE_BIN_DELTA} param alone now * @deprecated as of JE 6.0. The {@link #TREE_BIN_DELTA} param alone now
* determines whether a delta is logged. * determines whether a delta is logged.
*/ */
@Deprecated
public static final String TREE_MAX_DELTA = "je.tree.maxDelta"; public static final String TREE_MAX_DELTA = "je.tree.maxDelta";
/** /**
@ -2461,6 +2467,7 @@ public class EnvironmentConfig extends EnvironmentMutableConfig {
* any benefit and this feature has been removed. This parameter has no * any benefit and this feature has been removed. This parameter has no
* effect. * effect.
*/ */
@Deprecated
public static final String COMPRESSOR_PURGE_ROOT = public static final String COMPRESSOR_PURGE_ROOT =
"je.compressor.purgeRoot"; "je.compressor.purgeRoot";
@ -2505,6 +2512,7 @@ public class EnvironmentConfig extends EnvironmentMutableConfig {
* @deprecated as of JE 6.0. This parameter is ignored by the new, more * @deprecated as of JE 6.0. This parameter is ignored by the new, more
* efficient and more accurate evictor. * efficient and more accurate evictor.
*/ */
@Deprecated
public static final String EVICTOR_NODES_PER_SCAN = public static final String EVICTOR_NODES_PER_SCAN =
"je.evictor.nodesPerScan"; "je.evictor.nodesPerScan";
@ -2555,6 +2563,7 @@ public class EnvironmentConfig extends EnvironmentMutableConfig {
* @deprecated as of JE 4.1, since the single evictor thread has * @deprecated as of JE 4.1, since the single evictor thread has
* been replaced be a more robust thread pool. * been replaced be a more robust thread pool.
*/ */
@Deprecated
public static final String EVICTOR_DEADLOCK_RETRY = public static final String EVICTOR_DEADLOCK_RETRY =
"je.evictor.deadlockRetry"; "je.evictor.deadlockRetry";
@ -2562,6 +2571,7 @@ public class EnvironmentConfig extends EnvironmentMutableConfig {
* @deprecated as of JE 6.0. This parameter is ignored by the new, * @deprecated as of JE 6.0. This parameter is ignored by the new,
* more efficient and more accurate evictor. * more efficient and more accurate evictor.
*/ */
@Deprecated
public static final String EVICTOR_LRU_ONLY = "je.evictor.lruOnly"; public static final String EVICTOR_LRU_ONLY = "je.evictor.lruOnly";
/** /**
@ -3131,6 +3141,7 @@ public class EnvironmentConfig extends EnvironmentMutableConfig {
* @deprecated in JE 6.3. Adjustments are no longer needed because LN log * @deprecated in JE 6.3. Adjustments are no longer needed because LN log
* sizes have been stored in the Btree since JE 6.0. * sizes have been stored in the Btree since JE 6.0.
*/ */
@Deprecated
public static final String CLEANER_ADJUST_UTILIZATION = public static final String CLEANER_ADJUST_UTILIZATION =
"je.cleaner.adjustUtilization"; "je.cleaner.adjustUtilization";
@ -3283,6 +3294,7 @@ public class EnvironmentConfig extends EnvironmentMutableConfig {
* @deprecated in 7.0. No longer used because the cleaner no longer has a * @deprecated in 7.0. No longer used because the cleaner no longer has a
* backlog. * backlog.
*/ */
@Deprecated
public static final String CLEANER_MAX_BATCH_FILES = public static final String CLEANER_MAX_BATCH_FILES =
"je.cleaner.maxBatchFiles"; "je.cleaner.maxBatchFiles";
@ -3416,6 +3428,7 @@ public class EnvironmentConfig extends EnvironmentMutableConfig {
* longer supported due to its negative impact on eviction and Btree * longer supported due to its negative impact on eviction and Btree
* splits. To reduce a cleaner backlog, configure more cleaner threads. * splits. To reduce a cleaner backlog, configure more cleaner threads.
*/ */
@Deprecated
public static final String CLEANER_FOREGROUND_PROACTIVE_MIGRATION = public static final String CLEANER_FOREGROUND_PROACTIVE_MIGRATION =
"je.cleaner.foregroundProactiveMigration"; "je.cleaner.foregroundProactiveMigration";
@ -3425,6 +3438,7 @@ public class EnvironmentConfig extends EnvironmentMutableConfig {
* checkpointing. To reduce a cleaner backlog, configure more cleaner * checkpointing. To reduce a cleaner backlog, configure more cleaner
* threads. * threads.
*/ */
@Deprecated
public static final String CLEANER_BACKGROUND_PROACTIVE_MIGRATION = public static final String CLEANER_BACKGROUND_PROACTIVE_MIGRATION =
"je.cleaner.backgroundProactiveMigration"; "je.cleaner.backgroundProactiveMigration";
@ -3433,6 +3447,7 @@ public class EnvironmentConfig extends EnvironmentMutableConfig {
* supported due to its negative impact on eviction and checkpointing. * supported due to its negative impact on eviction and checkpointing.
* To reduce a cleaner backlog, configure more cleaner threads. * To reduce a cleaner backlog, configure more cleaner threads.
*/ */
@Deprecated
public static final String CLEANER_LAZY_MIGRATION = public static final String CLEANER_LAZY_MIGRATION =
"je.cleaner.lazyMigration"; "je.cleaner.lazyMigration";
@ -3613,6 +3628,7 @@ public class EnvironmentConfig extends EnvironmentMutableConfig {
* *
* @deprecated since JE 6.5; has no effect, as if it were set to false. * @deprecated since JE 6.5; has no effect, as if it were set to false.
*/ */
@Deprecated
public static final String LOCK_OLD_LOCK_EXCEPTIONS = public static final String LOCK_OLD_LOCK_EXCEPTIONS =
"je.lock.oldLockExceptions"; "je.lock.oldLockExceptions";
@ -3728,6 +3744,7 @@ public class EnvironmentConfig extends EnvironmentMutableConfig {
* set "com.sleepycat.je.util.FileHandler.level" in the EnvironmentConfig * set "com.sleepycat.je.util.FileHandler.level" in the EnvironmentConfig
* object. * object.
*/ */
@Deprecated
public static final String TRACE_FILE = "java.util.logging.FileHandler.on"; public static final String TRACE_FILE = "java.util.logging.FileHandler.on";
/** /**
@ -3740,6 +3757,7 @@ public class EnvironmentConfig extends EnvironmentMutableConfig {
* set "com.sleepycat.je.util.ConsoleHandler.level" in the * set "com.sleepycat.je.util.ConsoleHandler.level" in the
* EnvironmentConfig object. * EnvironmentConfig object.
*/ */
@Deprecated
public static final String TRACE_CONSOLE = public static final String TRACE_CONSOLE =
"java.util.logging.ConsoleHandler.on"; "java.util.logging.ConsoleHandler.on";
@ -3748,6 +3766,7 @@ public class EnvironmentConfig extends EnvironmentMutableConfig {
* separated from the java.util.logging mechanism. This parameter has * separated from the java.util.logging mechanism. This parameter has
* no effect. * no effect.
*/ */
@Deprecated
public static final String TRACE_DB = "java.util.logging.DbLogHandler.on"; public static final String TRACE_DB = "java.util.logging.DbLogHandler.on";
/** /**
@ -3757,6 +3776,7 @@ public class EnvironmentConfig extends EnvironmentMutableConfig {
* through the java.util.logging configuration file, or through the * through the java.util.logging configuration file, or through the
* java.util.logging.LogManager. * java.util.logging.LogManager.
*/ */
@Deprecated
public static final String TRACE_FILE_LIMIT = public static final String TRACE_FILE_LIMIT =
"java.util.logging.FileHandler.limit"; "java.util.logging.FileHandler.limit";
@ -3767,6 +3787,7 @@ public class EnvironmentConfig extends EnvironmentMutableConfig {
* through the java.util.logging configuration file, or through the * through the java.util.logging configuration file, or through the
* java.util.logging.LogManager. * java.util.logging.LogManager.
*/ */
@Deprecated
public static final String TRACE_FILE_COUNT = public static final String TRACE_FILE_COUNT =
"java.util.logging.FileHandler.count"; "java.util.logging.FileHandler.count";
@ -3776,6 +3797,7 @@ public class EnvironmentConfig extends EnvironmentMutableConfig {
* through the java.util.logging configuration file, or through the * through the java.util.logging configuration file, or through the
* java.util.logging.LogManager. * java.util.logging.LogManager.
*/ */
@Deprecated
public static final String TRACE_LEVEL = "java.util.logging.level"; public static final String TRACE_LEVEL = "java.util.logging.level";
/** /**
@ -3841,6 +3863,7 @@ public class EnvironmentConfig extends EnvironmentMutableConfig {
* java.util.logging configuration file, or through the * java.util.logging configuration file, or through the
* java.util.logging.LogManager. * java.util.logging.LogManager.
*/ */
@Deprecated
public static final String TRACE_LEVEL_LOCK_MANAGER = public static final String TRACE_LEVEL_LOCK_MANAGER =
"java.util.logging.level.lockMgr"; "java.util.logging.level.lockMgr";
@ -3851,6 +3874,7 @@ public class EnvironmentConfig extends EnvironmentMutableConfig {
* java.util.logging configuration file, or through the * java.util.logging configuration file, or through the
* java.util.logging.LogManager. * java.util.logging.LogManager.
*/ */
@Deprecated
public static final String TRACE_LEVEL_RECOVERY = public static final String TRACE_LEVEL_RECOVERY =
"java.util.logging.level.recovery"; "java.util.logging.level.recovery";
@ -3861,6 +3885,7 @@ public class EnvironmentConfig extends EnvironmentMutableConfig {
* java.util.logging configuration file, or through the * java.util.logging configuration file, or through the
* java.util.logging.LogManager. * java.util.logging.LogManager.
*/ */
@Deprecated
public static final String TRACE_LEVEL_EVICTOR = public static final String TRACE_LEVEL_EVICTOR =
"java.util.logging.level.evictor"; "java.util.logging.level.evictor";
@ -3871,6 +3896,7 @@ public class EnvironmentConfig extends EnvironmentMutableConfig {
* java.util.logging configuration file, or through the * java.util.logging configuration file, or through the
* java.util.logging.LogManager. * java.util.logging.LogManager.
*/ */
@Deprecated
public static final String TRACE_LEVEL_CLEANER = public static final String TRACE_LEVEL_CLEANER =
"java.util.logging.level.cleaner"; "java.util.logging.level.cleaner";
@ -4140,6 +4166,7 @@ public class EnvironmentConfig extends EnvironmentMutableConfig {
* @deprecated as of 4.0, replaced by {@link #setLockTimeout(long, * @deprecated as of 4.0, replaced by {@link #setLockTimeout(long,
* TimeUnit)}. * TimeUnit)}.
*/ */
@Deprecated
public EnvironmentConfig setLockTimeout(long timeout) public EnvironmentConfig setLockTimeout(long timeout)
throws IllegalArgumentException { throws IllegalArgumentException {
@ -4178,6 +4205,7 @@ public class EnvironmentConfig extends EnvironmentMutableConfig {
* *
* @deprecated as of 4.0, replaced by {@link #getLockTimeout(TimeUnit)}. * @deprecated as of 4.0, replaced by {@link #getLockTimeout(TimeUnit)}.
*/ */
@Deprecated
public long getLockTimeout() { public long getLockTimeout() {
return getLockTimeout(TimeUnit.MICROSECONDS); return getLockTimeout(TimeUnit.MICROSECONDS);
} }
@ -4342,6 +4370,7 @@ public class EnvironmentConfig extends EnvironmentMutableConfig {
* @deprecated as of 4.0, replaced by {@link #setTxnTimeout(long, * @deprecated as of 4.0, replaced by {@link #setTxnTimeout(long,
* TimeUnit)}. * TimeUnit)}.
*/ */
@Deprecated
public EnvironmentConfig setTxnTimeout(long timeout) public EnvironmentConfig setTxnTimeout(long timeout)
throws IllegalArgumentException { throws IllegalArgumentException {
@ -4381,6 +4410,7 @@ public class EnvironmentConfig extends EnvironmentMutableConfig {
* *
* @deprecated as of 4.0, replaced by {@link #getTxnTimeout(TimeUnit)}. * @deprecated as of 4.0, replaced by {@link #getTxnTimeout(TimeUnit)}.
*/ */
@Deprecated
public long getTxnTimeout() { public long getTxnTimeout() {
return getTxnTimeout(TimeUnit.MICROSECONDS); return getTxnTimeout(TimeUnit.MICROSECONDS);
} }

View file

@ -165,6 +165,7 @@ public class EnvironmentMutableConfig implements Cloneable, Serializable {
* *
* @deprecated replaced by {@link #setDurability} * @deprecated replaced by {@link #setDurability}
*/ */
@Deprecated
public EnvironmentMutableConfig setTxnNoSync(boolean noSync) { public EnvironmentMutableConfig setTxnNoSync(boolean noSync) {
setTxnNoSyncVoid(noSync); setTxnNoSyncVoid(noSync);
return this; return this;
@ -189,6 +190,7 @@ public class EnvironmentMutableConfig implements Cloneable, Serializable {
* *
* @deprecated replaced by {@link #getDurability} * @deprecated replaced by {@link #getDurability}
*/ */
@Deprecated
public boolean getTxnNoSync() { public boolean getTxnNoSync() {
return txnNoSync; return txnNoSync;
} }
@ -216,6 +218,7 @@ public class EnvironmentMutableConfig implements Cloneable, Serializable {
* *
* @deprecated replaced by {@link #setDurability} * @deprecated replaced by {@link #setDurability}
*/ */
@Deprecated
public EnvironmentMutableConfig setTxnWriteNoSync(boolean writeNoSync) { public EnvironmentMutableConfig setTxnWriteNoSync(boolean writeNoSync) {
setTxnWriteNoSyncVoid(writeNoSync); setTxnWriteNoSyncVoid(writeNoSync);
return this; return this;
@ -240,6 +243,7 @@ public class EnvironmentMutableConfig implements Cloneable, Serializable {
* *
* @deprecated replaced by {@link #getDurability} * @deprecated replaced by {@link #getDurability}
*/ */
@Deprecated
public boolean getTxnWriteNoSync() { public boolean getTxnWriteNoSync() {
return txnWriteNoSync; return txnWriteNoSync;
} }

View file

@ -1047,6 +1047,7 @@ public class EnvironmentStats implements Serializable {
* #getCurrentMinUtilization()} and {@link #getCurrentMaxUtilization()} to * #getCurrentMinUtilization()} and {@link #getCurrentMaxUtilization()} to
* monitor cleaner behavior. * monitor cleaner behavior.
*/ */
@Deprecated
public int getCleanerBacklog() { public int getCleanerBacklog() {
return 0; return 0;
} }
@ -1056,6 +1057,7 @@ public class EnvironmentStats implements Serializable {
* #getProtectedLogSize()} {@link #getProtectedLogSizeMap()} to monitor * #getProtectedLogSize()} {@link #getProtectedLogSizeMap()} to monitor
* file protection. * file protection.
*/ */
@Deprecated
public int getFileDeletionBacklog() { public int getFileDeletionBacklog() {
return 0; return 0;
} }
@ -1156,6 +1158,7 @@ public class EnvironmentStats implements Serializable {
* @deprecated in JE 6.5, use {@link #getCurrentMinUtilization()} or * @deprecated in JE 6.5, use {@link #getCurrentMinUtilization()} or
* {@link #getCurrentMaxUtilization()} instead. * {@link #getCurrentMaxUtilization()} instead.
*/ */
@Deprecated
public int getLastKnownUtilization() { public int getLastKnownUtilization() {
return getCurrentMinUtilization(); return getCurrentMinUtilization();
} }
@ -1164,6 +1167,7 @@ public class EnvironmentStats implements Serializable {
* @deprecated in JE 6.3. Adjustments are no longer needed because LN log * @deprecated in JE 6.3. Adjustments are no longer needed because LN log
* sizes have been stored in the Btree since JE 6.0. * sizes have been stored in the Btree since JE 6.0.
*/ */
@Deprecated
public float getLNSizeCorrectionFactor() { public float getLNSizeCorrectionFactor() {
return 1; return 1;
} }
@ -1171,6 +1175,7 @@ public class EnvironmentStats implements Serializable {
/** /**
* @deprecated in JE 5.0.56, use {@link #getCorrectedAvgLNSize} instead. * @deprecated in JE 5.0.56, use {@link #getCorrectedAvgLNSize} instead.
*/ */
@Deprecated
public float getCorrectedAvgLNSize() { public float getCorrectedAvgLNSize() {
return Float.NaN; return Float.NaN;
} }
@ -1178,6 +1183,7 @@ public class EnvironmentStats implements Serializable {
/** /**
* @deprecated in JE 5.0.56, use {@link #getCorrectedAvgLNSize} instead. * @deprecated in JE 5.0.56, use {@link #getCorrectedAvgLNSize} instead.
*/ */
@Deprecated
public float getEstimatedAvgLNSize() { public float getEstimatedAvgLNSize() {
return Float.NaN; return Float.NaN;
} }
@ -1279,6 +1285,7 @@ public class EnvironmentStats implements Serializable {
/** /**
* @deprecated in JE 6.3, always returns zero. * @deprecated in JE 6.3, always returns zero.
*/ */
@Deprecated
public long getNCleanerProbeRuns() { public long getNCleanerProbeRuns() {
return 0; return 0;
} }
@ -2263,6 +2270,7 @@ public class EnvironmentStats implements Serializable {
/** /**
* @deprecated The method returns 0 always. * @deprecated The method returns 0 always.
*/ */
@Deprecated
public long getRequiredEvictBytes() { public long getRequiredEvictBytes() {
return 0; return 0;
} }
@ -2271,6 +2279,7 @@ public class EnvironmentStats implements Serializable {
* @deprecated This statistic has no meaning after the implementation * @deprecated This statistic has no meaning after the implementation
* of the new evictor in JE 6.0. The method returns 0 always. * of the new evictor in JE 6.0. The method returns 0 always.
*/ */
@Deprecated
public long getNNodesScanned() { public long getNNodesScanned() {
return 0; return 0;
} }
@ -2278,6 +2287,7 @@ public class EnvironmentStats implements Serializable {
/** /**
* @deprecated Use {@link #getNEvictionRuns()} instead. * @deprecated Use {@link #getNEvictionRuns()} instead.
*/ */
@Deprecated
public long getNEvictPasses() { public long getNEvictPasses() {
return cacheStats.getLong(EVICTOR_EVICTION_RUNS); return cacheStats.getLong(EVICTOR_EVICTION_RUNS);
} }
@ -2285,6 +2295,7 @@ public class EnvironmentStats implements Serializable {
/** /**
* @deprecated use {@link #getNNodesTargeted()} instead. * @deprecated use {@link #getNNodesTargeted()} instead.
*/ */
@Deprecated
public long getNNodesSelected() { public long getNNodesSelected() {
return cacheStats.getLong(EVICTOR_NODES_TARGETED); return cacheStats.getLong(EVICTOR_NODES_TARGETED);
} }
@ -2292,6 +2303,7 @@ public class EnvironmentStats implements Serializable {
/** /**
* @deprecated Use {@link #getNNodesEvicted()} instead. * @deprecated Use {@link #getNNodesEvicted()} instead.
*/ */
@Deprecated
public long getNNodesExplicitlyEvicted() { public long getNNodesExplicitlyEvicted() {
return cacheStats.getLong(EVICTOR_NODES_EVICTED); return cacheStats.getLong(EVICTOR_NODES_EVICTED);
} }
@ -2299,6 +2311,7 @@ public class EnvironmentStats implements Serializable {
/** /**
* @deprecated Use {@link #getNNodesStripped()} instead. * @deprecated Use {@link #getNNodesStripped()} instead.
*/ */
@Deprecated
public long getNBINsStripped() { public long getNBINsStripped() {
return cacheStats.getLong(EVICTOR_NODES_STRIPPED); return cacheStats.getLong(EVICTOR_NODES_STRIPPED);
} }
@ -2306,6 +2319,7 @@ public class EnvironmentStats implements Serializable {
/** /**
* @deprecated Use {@link #getNNodesMutated()} instead. * @deprecated Use {@link #getNNodesMutated()} instead.
*/ */
@Deprecated
public long getNBINsMutated() { public long getNBINsMutated() {
return cacheStats.getLong(EVICTOR_NODES_MUTATED); return cacheStats.getLong(EVICTOR_NODES_MUTATED);
} }
@ -2924,6 +2938,7 @@ public class EnvironmentStats implements Serializable {
* @deprecated This statistic has been removed. The method returns 0 * @deprecated This statistic has been removed. The method returns 0
* always. * always.
*/ */
@Deprecated
public long getNBINsEvictedEvictorThread() { public long getNBINsEvictedEvictorThread() {
return 0; return 0;
} }
@ -2932,6 +2947,7 @@ public class EnvironmentStats implements Serializable {
* @deprecated This statistic has been removed. The method returns 0 * @deprecated This statistic has been removed. The method returns 0
* always. * always.
*/ */
@Deprecated
public long getNBINsEvictedManual() { public long getNBINsEvictedManual() {
return 0; return 0;
} }
@ -2940,6 +2956,7 @@ public class EnvironmentStats implements Serializable {
* @deprecated This statistic has been removed. The method returns 0 * @deprecated This statistic has been removed. The method returns 0
* always. * always.
*/ */
@Deprecated
public long getNBINsEvictedCritical() { public long getNBINsEvictedCritical() {
return 0; return 0;
} }
@ -2948,6 +2965,7 @@ public class EnvironmentStats implements Serializable {
* @deprecated This statistic has been removed. The method returns 0 * @deprecated This statistic has been removed. The method returns 0
* always. * always.
*/ */
@Deprecated
public long getNBINsEvictedCacheMode() { public long getNBINsEvictedCacheMode() {
return 0; return 0;
} }
@ -2956,6 +2974,7 @@ public class EnvironmentStats implements Serializable {
* @deprecated This statistic has been removed. The method returns 0 * @deprecated This statistic has been removed. The method returns 0
* always. * always.
*/ */
@Deprecated
public long getNBINsEvictedDaemon() { public long getNBINsEvictedDaemon() {
return 0; return 0;
} }
@ -2964,6 +2983,7 @@ public class EnvironmentStats implements Serializable {
* @deprecated This statistic has been removed. The method returns 0 * @deprecated This statistic has been removed. The method returns 0
* always. * always.
*/ */
@Deprecated
public long getNUpperINsEvictedEvictorThread() { public long getNUpperINsEvictedEvictorThread() {
return 0; return 0;
} }
@ -2972,6 +2992,7 @@ public class EnvironmentStats implements Serializable {
* @deprecated This statistic has been removed. The method returns 0 * @deprecated This statistic has been removed. The method returns 0
* always. * always.
*/ */
@Deprecated
public long getNUpperINsEvictedManual() { public long getNUpperINsEvictedManual() {
return 0; return 0;
} }
@ -2980,6 +3001,7 @@ public class EnvironmentStats implements Serializable {
* @deprecated This statistic has been removed. The method returns 0 * @deprecated This statistic has been removed. The method returns 0
* always. * always.
*/ */
@Deprecated
public long getNUpperINsEvictedCritical() { public long getNUpperINsEvictedCritical() {
return 0; return 0;
} }
@ -2988,6 +3010,7 @@ public class EnvironmentStats implements Serializable {
* @deprecated This statistic has been removed. The method returns 0 * @deprecated This statistic has been removed. The method returns 0
* always. * always.
*/ */
@Deprecated
public long getNUpperINsEvictedCacheMode() { public long getNUpperINsEvictedCacheMode() {
return 0; return 0;
} }
@ -2996,6 +3019,7 @@ public class EnvironmentStats implements Serializable {
* @deprecated This statistic has been removed. The method returns 0 * @deprecated This statistic has been removed. The method returns 0
* always. * always.
*/ */
@Deprecated
public long getNUpperINsEvictedDaemon() { public long getNUpperINsEvictedDaemon() {
return 0; return 0;
} }
@ -3004,6 +3028,7 @@ public class EnvironmentStats implements Serializable {
* @deprecated This statistic has been removed. The method returns 0 * @deprecated This statistic has been removed. The method returns 0
* always. * always.
*/ */
@Deprecated
public long getNBatchesEvictorThread() { public long getNBatchesEvictorThread() {
return 0; return 0;
} }
@ -3012,6 +3037,7 @@ public class EnvironmentStats implements Serializable {
* @deprecated This statistic has been removed. The method returns 0 * @deprecated This statistic has been removed. The method returns 0
* always. * always.
*/ */
@Deprecated
public long getNBatchesManual() { public long getNBatchesManual() {
return 0; return 0;
} }
@ -3020,6 +3046,7 @@ public class EnvironmentStats implements Serializable {
* @deprecated This statistic has been removed. The method returns 0 * @deprecated This statistic has been removed. The method returns 0
* always. * always.
*/ */
@Deprecated
public long getNBatchesCacheMode() { public long getNBatchesCacheMode() {
return 0; return 0;
} }
@ -3028,6 +3055,7 @@ public class EnvironmentStats implements Serializable {
* @deprecated This statistic has been removed. The method returns 0 * @deprecated This statistic has been removed. The method returns 0
* always. * always.
*/ */
@Deprecated
public long getNBatchesCritical() { public long getNBatchesCritical() {
return 0; return 0;
} }
@ -3036,6 +3064,7 @@ public class EnvironmentStats implements Serializable {
* @deprecated This statistic has been removed. The method returns 0 * @deprecated This statistic has been removed. The method returns 0
* always. * always.
*/ */
@Deprecated
public long getNBatchesDaemon() { public long getNBatchesDaemon() {
return 0; return 0;
} }
@ -3129,6 +3158,7 @@ public class EnvironmentStats implements Serializable {
* @deprecated This statistic has been removed. The method returns 0 * @deprecated This statistic has been removed. The method returns 0
* always. * always.
*/ */
@Deprecated
public long getAvgBatchEvictorThread() { public long getAvgBatchEvictorThread() {
return 0; return 0;
} }
@ -3137,6 +3167,7 @@ public class EnvironmentStats implements Serializable {
* @deprecated This statistic has been removed. The method returns 0 * @deprecated This statistic has been removed. The method returns 0
* always. * always.
*/ */
@Deprecated
public long getAvgBatchManual() { public long getAvgBatchManual() {
return 0; return 0;
} }
@ -3145,6 +3176,7 @@ public class EnvironmentStats implements Serializable {
* @deprecated This statistic has been removed. The method returns 0 * @deprecated This statistic has been removed. The method returns 0
* always. * always.
*/ */
@Deprecated
public long getAvgBatchCacheMode() { public long getAvgBatchCacheMode() {
return 0; return 0;
} }
@ -3153,6 +3185,7 @@ public class EnvironmentStats implements Serializable {
* @deprecated This statistic has been removed. The method returns 0 * @deprecated This statistic has been removed. The method returns 0
* always. * always.
*/ */
@Deprecated
public long getAvgBatchCritical() { public long getAvgBatchCritical() {
return 0; return 0;
} }
@ -3161,6 +3194,7 @@ public class EnvironmentStats implements Serializable {
* @deprecated This statistic has been removed. The method returns 0 * @deprecated This statistic has been removed. The method returns 0
* always. * always.
*/ */
@Deprecated
public long getAvgBatchDaemon() { public long getAvgBatchDaemon() {
return 0; return 0;
} }
@ -3314,6 +3348,7 @@ public class EnvironmentStats implements Serializable {
* {@link #getBufferBytes} to get other components of the total cache usage * {@link #getBufferBytes} to get other components of the total cache usage
* ({@link #getCacheTotalBytes}). * ({@link #getCacheTotalBytes}).
*/ */
@Deprecated
public long getCacheDataBytes() { public long getCacheDataBytes() {
return getCacheTotalBytes() - getBufferBytes(); return getCacheTotalBytes() - getBufferBytes();
} }

View file

@ -40,6 +40,7 @@ import com.sleepycat.je.txn.Locker;
* *
* @deprecated replaced by {@link LockNotAvailableException} * @deprecated replaced by {@link LockNotAvailableException}
*/ */
@Deprecated
public class LockNotGrantedException extends DeadlockException { public class LockNotGrantedException extends DeadlockException {
private static final long serialVersionUID = 646414701L; private static final long serialVersionUID = 646414701L;

View file

@ -44,6 +44,7 @@ import com.sleepycat.je.utilint.StatGroup;
* @deprecated as of 4.0.10, replaced by {@link * @deprecated as of 4.0.10, replaced by {@link
* Environment#getStats(StatsConfig)}.</p> * Environment#getStats(StatsConfig)}.</p>
*/ */
@Deprecated
public class LockStats implements Serializable { public class LockStats implements Serializable {
private static final long serialVersionUID = 172109534L; private static final long serialVersionUID = 172109534L;

View file

@ -127,6 +127,7 @@ public class PreloadStats implements Serializable {
* @deprecated returns zero for data written using JE 5.0 and later, but * @deprecated returns zero for data written using JE 5.0 and later, but
* may return non-zero values when reading older data. * may return non-zero values when reading older data.
*/ */
@Deprecated
public int getNDINsLoaded() { public int getNDINsLoaded() {
return nDINsLoaded; return nDINsLoaded;
} }
@ -135,6 +136,7 @@ public class PreloadStats implements Serializable {
* @deprecated returns zero for data written using JE 5.0 and later, but * @deprecated returns zero for data written using JE 5.0 and later, but
* may return non-zero values when reading older data. * may return non-zero values when reading older data.
*/ */
@Deprecated
public int getNDBINsLoaded() { public int getNDBINsLoaded() {
return nDBINsLoaded; return nDBINsLoaded;
} }
@ -143,6 +145,7 @@ public class PreloadStats implements Serializable {
* @deprecated returns zero for data written using JE 5.0 and later, but * @deprecated returns zero for data written using JE 5.0 and later, but
* may return non-zero values when reading older data. * may return non-zero values when reading older data.
*/ */
@Deprecated
public int getNDupCountLNsLoaded() { public int getNDupCountLNsLoaded() {
return nDupCountLNsLoaded; return nDupCountLNsLoaded;
} }

View file

@ -159,6 +159,7 @@ public class SecondaryCursor extends Cursor {
* *
* @deprecated As of JE 4.0.13, replaced by {@link Cursor#dup}.</p> * @deprecated As of JE 4.0.13, replaced by {@link Cursor#dup}.</p>
*/ */
@Deprecated
public SecondaryCursor dupSecondary(final boolean samePosition) { public SecondaryCursor dupSecondary(final boolean samePosition) {
return dup(samePosition); return dup(samePosition);
} }

View file

@ -562,6 +562,7 @@ public class SecondaryDatabase extends Database {
* For internal use only. * For internal use only.
*/ */
@Override @Override
@Deprecated
public void populateSecondaries(final Transaction txn, public void populateSecondaries(final Transaction txn,
final DatabaseEntry key, final DatabaseEntry key,
final DatabaseEntry data) { final DatabaseEntry data) {
@ -616,6 +617,7 @@ public class SecondaryDatabase extends Database {
* @deprecated As of JE 4.0.13, replaced by {@link * @deprecated As of JE 4.0.13, replaced by {@link
* SecondaryDatabase#getConfig()}. * SecondaryDatabase#getConfig()}.
*/ */
@Deprecated
public SecondaryConfig getSecondaryConfig() { public SecondaryConfig getSecondaryConfig() {
return getConfig(); return getConfig();
} }
@ -663,6 +665,7 @@ public class SecondaryDatabase extends Database {
* @deprecated As of JE 4.0.13, replaced by {@link * @deprecated As of JE 4.0.13, replaced by {@link
* SecondaryDatabase#openCursor}.</p> * SecondaryDatabase#openCursor}.</p>
*/ */
@Deprecated
public SecondaryCursor openSecondaryCursor( public SecondaryCursor openSecondaryCursor(
final Transaction txn, final Transaction txn,
final CursorConfig cursorConfig) { final CursorConfig cursorConfig) {

View file

@ -704,6 +704,7 @@ public class Transaction {
* @deprecated as of 4.0, replaced by {@link #setTxnTimeout(long, * @deprecated as of 4.0, replaced by {@link #setTxnTimeout(long,
* TimeUnit)}. * TimeUnit)}.
*/ */
@Deprecated
public void setTxnTimeout(long timeOut) public void setTxnTimeout(long timeOut)
throws IllegalArgumentException, DatabaseException { throws IllegalArgumentException, DatabaseException {
@ -783,6 +784,7 @@ public class Transaction {
* @deprecated as of 4.0, replaced by {@link #setLockTimeout(long, * @deprecated as of 4.0, replaced by {@link #setLockTimeout(long,
* TimeUnit)}. * TimeUnit)}.
*/ */
@Deprecated
public void setLockTimeout(long timeOut) public void setLockTimeout(long timeOut)
throws IllegalArgumentException, DatabaseException { throws IllegalArgumentException, DatabaseException {

View file

@ -153,6 +153,7 @@ public class TransactionConfig implements Cloneable {
* *
* @return this * @return this
*/ */
@Deprecated
public TransactionConfig setNoSync(final boolean noSync) { public TransactionConfig setNoSync(final boolean noSync) {
setNoSyncVoid(noSync); setNoSyncVoid(noSync);
return this; return this;
@ -176,6 +177,7 @@ public class TransactionConfig implements Cloneable {
* *
* @deprecated replaced by {@link #getDurability} * @deprecated replaced by {@link #getDurability}
*/ */
@Deprecated
public boolean getNoSync() { public boolean getNoSync() {
return noSync; return noSync;
} }
@ -202,6 +204,7 @@ public class TransactionConfig implements Cloneable {
* *
* @return this * @return this
*/ */
@Deprecated
public TransactionConfig setWriteNoSync(final boolean writeNoSync) { public TransactionConfig setWriteNoSync(final boolean writeNoSync) {
setWriteNoSyncVoid(writeNoSync); setWriteNoSyncVoid(writeNoSync);
return this; return this;
@ -225,6 +228,7 @@ public class TransactionConfig implements Cloneable {
* *
* @deprecated replaced by {@link #getDurability} * @deprecated replaced by {@link #getDurability}
*/ */
@Deprecated
public boolean getWriteNoSync() { public boolean getWriteNoSync() {
return writeNoSync; return writeNoSync;
} }

Some files were not shown because too many files have changed in this diff Show more