luceneserver icon indicating copy to clipboard operation
luceneserver copied to clipboard

There is an error when running ./build.py package

Open yangxi opened this issue 7 years ago • 0 comments

./build.py package compile 92 sources

src/java/org/apache/lucene/server/NRTPrimaryNode.java:387: error: writer is not public in PrimaryNode; cannot be accessed from outside package
    writer.getConfig().setRAMBufferSizeMB(mb);
    ^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: src/java/org/apache/lucene/server/GlobalState.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error

Traceback (most recent call last):
  File "./build.py", line 701, in <module>
    main()
  File "./build.py", line 511, in main
    jarFileName = compileSourcesAndDeps(jarVersion)
  File "./build.py", line 443, in compileSourcesAndDeps
    compileChangedSources('src/java', 'build/classes/java', l)
  File "./build.py", line 370, in compileChangedSources
    run(' '.join(cmd))
  File "./build.py", line 310, in run
    raise RuntimeError('command "%s" failed' % s)
RuntimeError: command "javac -Xmaxerrs 10000 -d build/classes/java -cp lib/jackson-core-2.8.2.jar:lib/commons-codec-1.10.jar:lib/json-smart-1.2.jar:lucene6x/lucene/build/core/lucene-core-6.3.0-SNAPSHOT.jar:lucene6x/lucene/build/analysis/common/lucene-analyzers-common-6.3.0-SNAPS..." failed

===================== Looks like it could be fixed either via setting the writer in PrimaryNode.java to protected final, or add the writer reference to NRTPrimaryNode.java

diff --git a/lucene/replicator/src/java/org/apache/lucene/replicator/nrt/PrimaryNode.java b/lucene/replicator/src/java/org/apache/lucene/replicator/nrt/PrimaryNode.java
index 8a3f07e..ee770cb 100644
--- a/lucene/replicator/src/java/org/apache/lucene/replicator/nrt/PrimaryNode.java
+++ b/lucene/replicator/src/java/org/apache/lucene/replicator/nrt/PrimaryNode.java
@@ -56,7 +56,7 @@ public abstract class PrimaryNode extends Node {
   // Current NRT segment infos, incRef'd with IndexWriter.deleter:
   private SegmentInfos curInfos;

-  final IndexWriter writer;
+  protected final IndexWriter writer;

   // IncRef'd state of the last published NRT point; when a replica comes asking, we give it this as the current NRT point:
   private CopyState copyState;

yangxi avatar Sep 26 '17 02:09 yangxi