├── .gitignore
├── bin
└── config_upgrade.sh
├── validators
├── solr_4_to_5_processors.xml
├── solrconfig_5_to_6_transformer.xslt
├── schema_5_to_6_transformer.xslt
├── solrconfig_4_to_5_transformer.xslt
├── solrconfig_5_to_6_validator.xslt
├── schema_5_to_6_validator.xslt
├── solrconfig_4_to_5_validator.xslt
└── schema_4_to_5_validator.xslt
├── src
├── main
│ ├── java
│ │ └── org
│ │ │ └── apache
│ │ │ └── solr
│ │ │ └── config
│ │ │ └── upgrade
│ │ │ ├── ValidationHandler.java
│ │ │ ├── UpgradeConfigException.java
│ │ │ ├── UpgradeProcessorsConfigFactory.java
│ │ │ ├── ConfigType.java
│ │ │ ├── SuppressCompilerWarnings.java
│ │ │ ├── UpgradeProcessorsConfig.java
│ │ │ ├── ConfigValidator.java
│ │ │ ├── ToolParams.java
│ │ │ ├── ConfigTransformer.java
│ │ │ ├── impl
│ │ │ └── DefaultValidationResultProcessor.java
│ │ │ └── ConfigUpgradeTool.java
│ └── resources
│ │ └── validation_result_summary.xslt
├── assembly
│ └── bin.xml
└── test
│ └── resources
│ ├── bad_config
│ └── solr5
│ │ ├── schema_2.xml
│ │ └── schema_1.xml
│ └── good_config
│ └── schema.xml
├── pom.xml
├── README.md
└── LICENSE
/.gitignore:
--------------------------------------------------------------------------------
1 | # .
2 | /.project
3 | /.classpath
4 | /.settings
5 | target/*
6 | dependency-reduced-pom.xml
7 | /target/
8 |
--------------------------------------------------------------------------------
/bin/config_upgrade.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | : ${JAVA_HOME:?"Please configure JAVA_HOME environment variable"}
4 |
5 | JVM="java"
6 | SCRIPT_DIR=$(dirname "$0")
7 |
8 | PATH="${JAVA_HOME}/bin:${PATH}" ${JVM} $JAVA_OPTS -cp "${SCRIPT_DIR}/lib/*" org.apache.solr.config.upgrade.ConfigUpgradeTool "$@"
9 |
10 |
--------------------------------------------------------------------------------
/validators/solr_4_to_5_processors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
8 |
9 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/solr/config/upgrade/ValidationHandler.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.apache.solr.config.upgrade;
19 |
20 | import org.w3c.dom.Document;
21 |
22 | public interface ValidationHandler {
23 | void begin(String confName);
24 | boolean process (String confName, Document result);
25 | }
26 |
--------------------------------------------------------------------------------
/src/assembly/bin.xml:
--------------------------------------------------------------------------------
1 |
4 | bin
5 |
6 | tar.gz
7 |
8 |
9 |
10 | ${project.basedir}
11 |
12 |
13 | README*
14 | LICENSE*
15 | NOTICE*
16 |
17 |
18 |
19 | ${project.build.directory}
20 | lib
21 |
22 | ${project.artifactId}-${project.version}.jar
23 |
24 |
25 |
26 | ${project.basedir}/bin
27 |
28 |
29 | *.sh
30 |
31 |
32 |
33 | ${project.basedir}/validators
34 | validators
35 |
36 | *
37 |
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/solr/config/upgrade/UpgradeConfigException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 | package org.apache.solr.config.upgrade;
18 |
19 | @SuppressWarnings("serial")
20 | public class UpgradeConfigException extends RuntimeException {
21 |
22 | public UpgradeConfigException() {
23 | }
24 |
25 | public UpgradeConfigException(String message, Throwable cause, boolean enableSuppression,
26 | boolean writableStackTrace) {
27 | super(message, cause, enableSuppression, writableStackTrace);
28 | }
29 |
30 | public UpgradeConfigException(String message, Throwable cause) {
31 | super(message, cause);
32 | }
33 |
34 | public UpgradeConfigException(String message) {
35 | super(message);
36 | }
37 |
38 | public UpgradeConfigException(Throwable cause) {
39 | super(cause);
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/solr/config/upgrade/UpgradeProcessorsConfigFactory.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 | package org.apache.solr.config.upgrade;
18 |
19 | import java.io.IOException;
20 | import java.nio.file.Path;
21 |
22 | import com.fasterxml.jackson.core.JsonParseException;
23 | import com.fasterxml.jackson.databind.JsonMappingException;
24 | import com.fasterxml.jackson.dataformat.xml.JacksonXmlModule;
25 | import com.fasterxml.jackson.dataformat.xml.XmlMapper;
26 |
27 | public class UpgradeProcessorsConfigFactory {
28 |
29 | public static UpgradeProcessorsConfig newInstance(Path configFilePath)
30 | throws JsonParseException, JsonMappingException, IOException {
31 | JacksonXmlModule module = new JacksonXmlModule();
32 | module.setDefaultUseWrapper(false);
33 | XmlMapper xmlMapper = new XmlMapper(module);
34 |
35 | return xmlMapper.readValue(configFilePath.toFile(), UpgradeProcessorsConfig.class);
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/validators/solrconfig_5_to_6_transformer.xslt:
--------------------------------------------------------------------------------
1 |
3 |
4 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 | * Removed "nrtMode" configuration from "indexConfig" section
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/solr/config/upgrade/ConfigType.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 | package org.apache.solr.config.upgrade;
18 |
19 | /**
20 | * This enum defines Solr configuration which can be verified by compatibility checker
21 | */
22 | public enum ConfigType {
23 | SCHEMA_XML("schema"), SOLRCONFIG_XML("solrconfig"), CONFIGSET("configset");
24 |
25 | private String configType;
26 |
27 | private ConfigType(String configType) {
28 | this.configType = configType;
29 | }
30 |
31 | public String getConfigType() {
32 | return configType;
33 | }
34 |
35 | public static ConfigType getConfigType(String configType) {
36 | if (SCHEMA_XML.getConfigType().equalsIgnoreCase(configType)) {
37 | return ConfigType.SCHEMA_XML;
38 | } else if (SOLRCONFIG_XML.getConfigType().equalsIgnoreCase(configType)) {
39 | return ConfigType.SOLRCONFIG_XML;
40 | } else if (CONFIGSET.getConfigType().equalsIgnoreCase(configType)) {
41 | return ConfigType.CONFIGSET;
42 | }
43 | throw new IllegalArgumentException("Invalid configType "+configType);
44 | }
45 |
46 | @Override
47 | public String toString() {
48 | return configType;
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/validators/schema_5_to_6_transformer.xslt:
--------------------------------------------------------------------------------
1 |
3 |
4 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 | * Replacing usage of DefaultSimilarityFactory with ClassicSimilarityFactory
46 |
47 |
48 | solr.ClassicSimilarityFactory
49 |
50 |
51 |
52 |
53 |
54 |
55 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/solr/config/upgrade/SuppressCompilerWarnings.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 | package org.apache.solr.config.upgrade;
18 |
19 | import javax.xml.transform.ErrorListener;
20 | import javax.xml.transform.TransformerException;
21 |
22 | /**
23 | * The Java XSLT compiler generates number of warnings which (generally) do not affect the result of
24 | * the transformation. This class allows the upgrade tool to suppress such warnings. During the development
25 | * of the upgrade rules, display of such warnings can be enabled by providing "-v" command line parameter.
26 | */
27 | class SuppressCompilerWarnings implements ErrorListener {
28 | private final boolean verbose;
29 |
30 | public SuppressCompilerWarnings(boolean verbose) {
31 | this.verbose = verbose;
32 | }
33 |
34 | @Override
35 | public void warning(TransformerException exception) throws TransformerException {
36 | if (verbose) {
37 | System.err.println(exception.getMessageAndLocation());
38 | }
39 | }
40 |
41 | @Override
42 | public void error(TransformerException exception) throws TransformerException {
43 | System.err.println(exception.getMessageAndLocation());
44 | }
45 |
46 | @Override
47 | public void fatalError(TransformerException exception) throws TransformerException {
48 | System.err.println(exception.getMessageAndLocation());
49 | }
50 | }
--------------------------------------------------------------------------------
/pom.xml:
--------------------------------------------------------------------------------
1 |
3 | 4.0.0
4 | org.apache.solr
5 | solr-upgrade-tool
6 | 0.0.1-SNAPSHOT
7 |
8 | 1.8
9 | 1.8
10 |
11 |
12 |
13 | commons-cli
14 | commons-cli
15 | 1.3
16 |
17 |
18 | com.fasterxml.jackson.core
19 | jackson-databind
20 | 2.8.9
21 |
22 |
23 | com.fasterxml.jackson.core
24 | jackson-annotations
25 | 2.8.9
26 |
27 |
28 | com.fasterxml.jackson.dataformat
29 | jackson-dataformat-xml
30 | 2.8.9
31 |
32 |
33 |
34 |
35 |
36 | org.apache.maven.plugins
37 | maven-shade-plugin
38 | 3.0.0
39 |
40 |
41 | package
42 |
43 | shade
44 |
45 |
46 |
47 |
48 |
49 | maven-assembly-plugin
50 | 3.1.0
51 |
52 |
53 | src/assembly/bin.xml
54 |
55 |
56 |
57 |
58 | create-archive
59 | package
60 |
61 | single
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/solr/config/upgrade/UpgradeProcessorsConfig.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 | package org.apache.solr.config.upgrade;
18 |
19 | import java.util.Objects;
20 | import java.util.Optional;
21 |
22 | import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
23 | import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
24 |
25 | @JacksonXmlRootElement(localName = "upgradeProcessors")
26 | public class UpgradeProcessorsConfig {
27 | @JacksonXmlProperty(isAttribute = true)
28 | private int inputVersion;
29 |
30 | @JacksonXmlProperty(isAttribute = true)
31 | private int outputVersion;
32 |
33 | @JacksonXmlProperty(localName="processor")
34 | private ProcessorConfig[] processors;
35 |
36 | public int getInputVersion() {
37 | return inputVersion;
38 | }
39 |
40 | public int getOutputVersion() {
41 | return outputVersion;
42 | }
43 |
44 | public Optional getProcessorByConfigType(ConfigType confType) {
45 | for (ProcessorConfig p : processors) {
46 | if (Objects.equals(confType.getConfigType(), p.getConfigType())) {
47 | return Optional.of(p);
48 | }
49 | }
50 |
51 | return Optional.empty();
52 | }
53 |
54 | public static class ProcessorConfig {
55 | @JacksonXmlProperty(isAttribute = true)
56 | private String configType;
57 |
58 | @JacksonXmlProperty(isAttribute=true)
59 | private String validatorPath;
60 |
61 | @JacksonXmlProperty(isAttribute=true)
62 | private String transformerPath;
63 |
64 | public String getConfigType() {
65 | return configType;
66 | }
67 |
68 | public String getValidatorPath() {
69 | return validatorPath;
70 | }
71 |
72 | public String getTransformerPath() {
73 | return transformerPath;
74 | }
75 | }
76 | }
77 |
--------------------------------------------------------------------------------
/validators/solrconfig_4_to_5_transformer.xslt:
--------------------------------------------------------------------------------
1 |
3 |
4 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 | * Removed "termIndexInterval" configuration from "indexConfig" section
47 |
48 |
49 | * Removed "checkIntegrityAtMerge" configuration from "indexConfig" section
50 |
51 |
52 | * Removed "nrtMode" configuration from "indexConfig" section
53 |
54 |
55 |
56 |
57 | * Using <arr name="fieldName"> init param style for UniqFieldsUpdateProcessorFactory
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/solr/config/upgrade/ConfigValidator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 | package org.apache.solr.config.upgrade;
18 |
19 | import java.nio.file.Files;
20 | import java.nio.file.Path;
21 | import java.nio.file.Paths;
22 |
23 | import javax.xml.transform.Source;
24 | import javax.xml.transform.Transformer;
25 | import javax.xml.transform.TransformerConfigurationException;
26 | import javax.xml.transform.TransformerException;
27 | import javax.xml.transform.dom.DOMResult;
28 | import javax.xml.transform.stream.StreamSource;
29 |
30 | import org.apache.solr.config.upgrade.UpgradeProcessorsConfig.ProcessorConfig;
31 | import org.w3c.dom.Document;
32 |
33 | /**
34 | * TODO
35 | */
36 | public class ConfigValidator {
37 | private final String confName;
38 | private final Transformer transformer;
39 |
40 | public ConfigValidator(ToolParams params, String confName, ProcessorConfig procConfig) {
41 | this.confName = confName;
42 | this.transformer = buildTransformer(params, procConfig);
43 | }
44 |
45 | public boolean validate(Source config, ValidationHandler handler) throws TransformerException {
46 | handler.begin(confName);
47 | DOMResult validationResult = new DOMResult();
48 | transformer.transform(config, validationResult);
49 | return handler.process(confName, (Document)validationResult.getNode());
50 | }
51 |
52 | protected Transformer buildTransformer(ToolParams params, ProcessorConfig procConfig) {
53 | Path scriptPath = Paths.get(procConfig.getValidatorPath());
54 | if (!scriptPath.isAbsolute()) {
55 | scriptPath = params.getProcessorConfPath().getParent().resolve(scriptPath);
56 | }
57 | if (!Files.exists(scriptPath)) {
58 | throw new IllegalArgumentException("Unable to find validation script "+scriptPath);
59 | }
60 | try {
61 | return params.getFactory().newTransformer(new StreamSource(scriptPath.toFile())) ;
62 | } catch (TransformerConfigurationException e) {
63 | throw new UpgradeConfigException(e);
64 | }
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/validators/solrconfig_5_to_6_validator.xslt:
--------------------------------------------------------------------------------
1 |
3 |
4 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 | info
39 | TBD
40 | The implicit default schema factory is changed from ClassicIndexSchemaFactory to ManagedIndexSchemaFactory. This means that the Schema APIs ( /<collection>/schema ) are enabled and the schema is mutable.
41 | Users who wish to preserve back-compatible behavior should either explicitly configure schemaFactory to use ClassicIndexSchemaFactory, or ensure that the luceneMatchVersion for the collection is less then 6.0
42 | no
43 | no
44 |
45 |
46 |
47 |
48 |
49 |
50 | Parent is :
51 |
52 |
53 |
54 |
55 |
56 | info
57 | SOLR-6897
58 | The <nrtMode> configuration has been discontinued and should be removed
59 | Solr defaults to using NRT searchers and this configuration is not required
60 | No
61 | yes
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/solr/config/upgrade/ToolParams.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 | package org.apache.solr.config.upgrade;
18 |
19 | import java.nio.file.Files;
20 | import java.nio.file.Path;
21 |
22 | import javax.xml.transform.TransformerFactory;
23 |
24 | public class ToolParams {
25 | private final ConfigType confType;
26 | private final Path solrConfPath;
27 | private final Path processorConfPath;
28 | private final Path resultDirPath;
29 | private final boolean dryRun;
30 | private final TransformerFactory factory;
31 | private final UpgradeProcessorsConfig upgradeProcessorConf;
32 |
33 | public ToolParams(ConfigType confType, Path solrConfPath, Path processorConfPath,
34 | Path resultDirPath, boolean dryRun, boolean verbose) throws Exception {
35 | this.confType = confType;
36 | this.solrConfPath = solrConfPath;
37 | this.processorConfPath = processorConfPath;
38 | this.resultDirPath = resultDirPath;
39 | this.dryRun = dryRun;
40 | this.factory = TransformerFactory.newInstance();
41 | this.factory.setErrorListener(new SuppressCompilerWarnings(verbose));
42 | this.upgradeProcessorConf = UpgradeProcessorsConfigFactory.newInstance(processorConfPath);
43 | }
44 |
45 | public ConfigType getConfType() {
46 | return confType;
47 | }
48 |
49 | public Path getSolrConfPath() {
50 | return solrConfPath;
51 | }
52 |
53 | public Path getResultDirPath() {
54 | return resultDirPath;
55 | }
56 |
57 | public TransformerFactory getFactory() {
58 | return factory;
59 | }
60 |
61 | public boolean isDryRun() {
62 | return dryRun;
63 | }
64 |
65 | public Path getProcessorConfPath() {
66 | return processorConfPath;
67 | }
68 |
69 | public UpgradeProcessorsConfig getUpgradeProcessorConf() {
70 | return upgradeProcessorConf;
71 | }
72 |
73 | /**
74 | * Validate the specified input parameters
75 | */
76 | public void checkArgs() {
77 | if (!Files.exists(solrConfPath)) {
78 | throw new IllegalStateException("Unable to locate the Solr configuration " + solrConfPath);
79 | }
80 | if (!Files.exists(processorConfPath)) {
81 | throw new IllegalStateException("Unable to locate upgrade processor config file " + processorConfPath);
82 | }
83 | if (!Files.exists(resultDirPath)) {
84 | throw new IllegalArgumentException("The result directory ( " + resultDirPath+" ) does not exist.");
85 | }
86 | }
87 |
88 | }
89 |
--------------------------------------------------------------------------------
/src/main/resources/validation_result_summary.xslt:
--------------------------------------------------------------------------------
1 |
2 |
3 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
Following configuration errors found:
29 |
30 | *
31 |
32 |
33 |
34 | No configuration errors found...
35 |
36 |
37 |
38 |
Following configuration warnings found:
39 |
40 | *
41 |
42 |
43 |
44 | No configuration warnings found...
45 |
46 |
47 |
48 |
Following incompatibilities will be fixed by auto-transformations (using --upgrade command):
49 |
50 | *
51 |
52 |
53 |
54 |
55 |
Please note that in Solr :
56 |
57 | *
58 |
59 |
60 |
61 |
62 |
63 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/solr/config/upgrade/ConfigTransformer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 | package org.apache.solr.config.upgrade;
18 |
19 | import java.nio.file.Files;
20 | import java.nio.file.Path;
21 | import java.nio.file.Paths;
22 |
23 | import javax.xml.transform.OutputKeys;
24 | import javax.xml.transform.Source;
25 | import javax.xml.transform.Transformer;
26 | import javax.xml.transform.TransformerConfigurationException;
27 | import javax.xml.transform.TransformerException;
28 | import javax.xml.transform.stream.StreamResult;
29 | import javax.xml.transform.stream.StreamSource;
30 |
31 | import org.apache.solr.config.upgrade.UpgradeProcessorsConfig.ProcessorConfig;
32 |
33 | public class ConfigTransformer {
34 | private final Transformer transformer;
35 | private final Path resultFile;
36 |
37 | public ConfigTransformer(ToolParams params, ProcessorConfig procConfig) {
38 | try {
39 | this.transformer = buildTransformer(params, procConfig);
40 | } catch (TransformerConfigurationException e) {
41 | throw new UpgradeConfigException (e);
42 | }
43 |
44 | String confFileName = params.getSolrConfPath().getFileName().toString();
45 | this.resultFile = params.getResultDirPath().resolve(confFileName);
46 | }
47 |
48 | public void transform (Source config) throws TransformerException {
49 | System.out.println("Applying auto transformations...");
50 | transformer.transform(config, new StreamResult(resultFile.toFile()));
51 | System.out.println();
52 | System.out.println("The upgraded configuration file is available at " + resultFile);
53 | }
54 |
55 | protected Transformer buildTransformer(ToolParams params, ProcessorConfig procConfig)
56 | throws TransformerConfigurationException {
57 | Transformer result = params.getFactory().newTransformer(); // identity transform.
58 |
59 | if (procConfig.getTransformerPath() != null) {
60 | Path scriptPath = Paths.get(procConfig.getTransformerPath());
61 | if (!scriptPath.isAbsolute()) {
62 | scriptPath = params.getProcessorConfPath().getParent().resolve(scriptPath);
63 | }
64 | if (!Files.exists(scriptPath)) {
65 | throw new IllegalArgumentException("Unable to find transformation script "+scriptPath);
66 | }
67 | result = params.getFactory().newTransformer(new StreamSource(scriptPath.toFile()));
68 | }
69 |
70 | result.setOutputProperty(OutputKeys.INDENT, "yes");
71 | result.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");
72 | return result;
73 | }
74 |
75 | }
76 |
--------------------------------------------------------------------------------
/validators/schema_5_to_6_validator.xslt:
--------------------------------------------------------------------------------
1 |
3 |
4 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 | info
39 | SOLR-8270, SOLR-8271
40 | The implicit default Similarity is changed to SchemaSimilarityFactory
41 | Users who wish to preserve back-compatible behavior should either explicitly configure ClassicSimilarityFactory, or ensure that the luceneMatchVersion for the collection is less then 6.0
42 | TBD
43 | no
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 | info
52 | SOLR-8239
53 | DefaultSimilarityFactory has been removed
54 | If you currently have DefaultSimilarityFactory explicitly referenced in your schema.xml, edit your config to use the functionally identical ClassicSimilarityFactory
55 | TBD
56 | yes
57 |
58 |
59 |
60 |
61 |
62 | info
63 | SOLR-8261, SOLR-8329
64 | SchemaSimilarityFactory has been modified to use BM25Similarity as the default for fieldTypes that do not explicitly declare a Similarity
65 | The legacy behavior of using ClassicSimilarity as the default will occur if the luceneMatchVersion for the collection is less then 6.0, or the 'defaultSimFromFieldType' configuration option may be used to specify any default of your choosing
66 | TBD
67 | no
68 |
69 |
70 |
71 |
72 |
--------------------------------------------------------------------------------
/validators/solrconfig_4_to_5_validator.xslt:
--------------------------------------------------------------------------------
1 |
3 |
4 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 | info
39 | SOLR-6560
40 | The "termIndexInterval" option is a no-op and should be removed
41 | TBD
42 | No
43 | yes
44 |
45 |
46 |
47 |
48 |
49 | info
50 | SOLR-6834
51 | The "checkIntegrityAtMerge" option is a no-op and should be removed
52 | TBD
53 | No
54 | yes
55 |
56 |
57 |
58 |
59 |
60 | info
61 | SOLR-6897
62 | The <nrtMode> configuration has been discontinued and should be removed
63 | Solr defaults to using NRT searchers and this configuration is not required
64 | No
65 | yes
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 | error
76 | TBD
77 | The "file" attribute of infoStream element is removed
78 | Control this via your logging configuration (org.apache.solr.update.LoggingInfoStream) instead
79 | No
80 | no
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 | info
90 | SOLR-4249
91 | UniqFieldsUpdateProcessorFactory no longer supports the <lst named="fields"> init param style
92 | Update your solrconfig.xml to use <arr name="fieldName"> instead
93 | No
94 | yes
95 |
96 |
97 |
98 |
99 |
100 |
101 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/solr/config/upgrade/impl/DefaultValidationResultProcessor.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.apache.solr.config.upgrade.impl;
19 |
20 | import javax.xml.transform.OutputKeys;
21 | import javax.xml.transform.Transformer;
22 | import javax.xml.transform.TransformerFactory;
23 | import javax.xml.transform.dom.DOMSource;
24 | import javax.xml.transform.stream.StreamResult;
25 | import javax.xml.transform.stream.StreamSource;
26 | import javax.xml.xpath.XPath;
27 | import javax.xml.xpath.XPathConstants;
28 | import javax.xml.xpath.XPathExpressionException;
29 | import javax.xml.xpath.XPathFactory;
30 |
31 | import org.apache.solr.config.upgrade.ConfigUpgradeTool;
32 | import org.apache.solr.config.upgrade.ToolParams;
33 | import org.apache.solr.config.upgrade.ValidationHandler;
34 | import org.w3c.dom.Document;
35 | import org.w3c.dom.NodeList;
36 |
37 | public class DefaultValidationResultProcessor implements ValidationHandler {
38 | private final ToolParams params;
39 |
40 | public DefaultValidationResultProcessor(ToolParams params) {
41 | this.params = params;
42 | }
43 |
44 | @Override
45 | public void begin(String confName) {
46 | System.out.println("Validating "+confName+"...");
47 | //System.out.println();
48 | }
49 |
50 | @Override
51 | public boolean process(String confName, Document result) {
52 | StreamSource resultSummaryProcessor = new StreamSource(
53 | ConfigUpgradeTool.class.getClassLoader()
54 | .getResourceAsStream("validation_result_summary.xslt"));
55 |
56 | try {
57 | Transformer summaryTransform =
58 | TransformerFactory.newInstance().newTransformer(resultSummaryProcessor);
59 | summaryTransform.setParameter("solrOpVersion", this.params.getUpgradeProcessorConf().getOutputVersion());
60 | summaryTransform.setParameter("dryRun", this.params.isDryRun());
61 | summaryTransform.transform(new DOMSource(result), new StreamResult(System.out));
62 |
63 | // Store the results in the specified directory.
64 | Transformer saveTransform = TransformerFactory.newInstance().newTransformer();
65 | saveTransform.setOutputProperty(OutputKeys.INDENT, "yes");
66 | saveTransform.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");
67 | saveTransform.transform(new DOMSource(result),
68 | new StreamResult(this.params.getResultDirPath().resolve(confName+"_validation.xml").toFile()));
69 |
70 | if (evaluateXPathExpression(result, "/result/incompatibility[contains(level, 'error')]").getLength() == 0) {
71 | System.out.println();
72 | System.out.printf("Solr %s validation is successful. Please review %s for more details. \n",
73 | confName, params.getResultDirPath().resolve(confName+"_validation.xml").toAbsolutePath());
74 | System.out.println();
75 | return true;
76 | } else {
77 | System.out.println();
78 | System.out.printf("Solr %s validation failed. Please review %s for more details. \n",
79 | confName, params.getResultDirPath().resolve(confName+"_validation.xml"));
80 | System.out.println();
81 | return false;
82 | }
83 |
84 | } catch (Exception ex) {
85 | throw new RuntimeException(ex);
86 | }
87 | }
88 |
89 | private static NodeList evaluateXPathExpression (Document doc, String expr) throws XPathExpressionException {
90 | XPath xpath = XPathFactory.newInstance().newXPath();
91 | return (NodeList)xpath.compile(expr).evaluate(doc, XPathConstants.NODESET);
92 | }
93 |
94 |
95 | }
96 |
--------------------------------------------------------------------------------
/validators/schema_4_to_5_validator.xslt:
--------------------------------------------------------------------------------
1 |
3 |
4 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
48 |
49 | error
50 | SOLR-5936
51 | Legacy field type (name = and class = ) is removed.
52 | TBD
53 | Required
54 | no
55 |
56 |
57 |
58 |
61 |
62 | error
63 | SOLR-6797
64 | 'units' attribute for spatial field type (name = and class = ) is deprecated
66 |
67 | Spatial fields originating from Solr 4 (e.g. SpatialRecursivePrefixTreeFieldType, BBoxField)
68 | have the 'units' attribute deprecated, now replaced with 'distanceUnits'. If you change it to
69 | a unit other than 'degrees' (or if you don't specify it, which will default to kilometers if
70 | geo=true), then be sure to update maxDistErr as it's in those units. If you keep units=degrees
71 | then it should be backwards compatible but you'll get a deprecation warning on startup.
72 |
73 | Required
74 | no
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 | info
85 | LUCENE-6058
86 | Users of the BeiderMorseFilterFactory will need to rebuild their indexes after upgrading
87 |
88 | Due to changes in the underlying commons-codec package, users of the BeiderMorseFilterFactory will need to rebuild their indexes after upgrading.
89 |
90 | Required
91 | no
92 |
93 |
94 |
95 |
96 |
97 | error
98 | TODO
99 | LegacyHTMLStripCharFilter has been removed
100 | TBD
101 | Required
102 | no
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Solr config upgrade tool
2 |
3 | Despite widespread enterprise adoption, Solr lacks automated upgrade tooling. It has long been a challenge for users to understand the implications of a Solr upgrade. Users must manually review the Solr release notes to identify configuration changes either to fix backwards incompatibilities or to utilize latest features in the new version. Additionally, users must identify a way to migrate existing index data to the new version (either via an index upgrade or re-indexing the raw data).
4 |
5 | Solr config upgrade tool aims to simplify the upgrade process by providing upgrade instructions tailored to your configuration. These instuctions can help you to answer following questions
6 |
7 | - Does my Solr configuration have any backwards incompatible sections? If yes which ones?
8 | - For each of the incompatibility - what do I need to do to fix this incompatibility? Where can I get more information about why this incompatibility was introduced (e.g. references to Lucene/Solr jiras)?
9 | - Are there any changes in Lucene/Solr which would require me to do a full reindexing OR can I get away with an index upgrade?
10 |
11 | ## High level design
12 |
13 | This tool is built using [Extensible Stylesheet Language Transformations](https://en.wikipedia.org/wiki/XSLT) engine. The upgrade rules, implemented in the form of XSLT transformations, can identify backwards incompatibilities and in some cases can even fix them automatically.
14 |
15 | In general, an incompatibility can be categorized as follows,
16 | - An incompatibility due to removal of Lucene/Solr configuration element (e.g. a field type) is marked as ERROR in the validation result. Typically this will result in failure to start the Solr server (or load the core). User must make changes to Solr configuration using application specific knowledge to fix such incompatibility.
17 | - An incompatibility due to deprecation of a configuration section in the new Solr version is marked as WARNING in the validation result. Typically this will not result in any failure during Solr server startup (or core loading), but may prevent application from utilizing new Lucene/Solr features (or bug-fixes). User may choose to make changes to Solr configuration using application specific knowledge to fix such incompatibility.
18 | - An incompatibility which can be fixed automatically (e.g. by rewriting the Solr configuration section) and do not require any manual intervention is marked as INFO in the validation result. This also includes incompatibilities in the underlying Lucene implementation (e.g. [LUCENE-6058](https://issues.apache.org/jira/browse/LUCENE-6058)) which would require rebuilding the index (instead of index upgrade). Typically such incompatibility will not result in failure during Solr server startup (or core loading), but may affect the accuracy of the query results or consistency of underlying indexed data.
19 |
20 | ## Steps to run this tool
21 |
22 | - Build this project using maven (mvn clean install)
23 | - Run the config upgrade tool as follows
24 | ```bash
25 | ./bin/config_upgrade.sh --help
26 | usage: ConfigUpgradeTool
27 | -t This parameter specifies the type of Solr configuration to
28 | be validated and transformed.The tool currently supports
29 | schema.xml, solrconfig.xml and solr.xml
30 | --help This command will print the help message for the Solr
31 | config upgrade related commands.
32 | --dry-run This command will perform compatibility checks for the
33 | specified Solr config file.
34 | -c This parameter specifies the path of Solr configuration to
35 | be upgraded.
36 | -u This parameter specifies the path of the file providing
37 | Solr upgrade processor configurations.
38 | -d This parameter specifies the directory path where
39 | tansformed Solr configuration should be stored.
40 | -v This parameter enables printing XSLT compiler warnings on
41 | the command output.
42 | ```
43 |
44 | e.g. following command runs the upgrade tool on a Solr schema.xml of version 4.x to identify incomatibilities before upgrade to Solr 5
45 |
46 | ```bash
47 | ./bin/config_upgrade.sh -t schema -c src/test/resources/bad_config/solr4/schema.xml -u validators/solr_4_to_5_processors.xml -d /tmp
48 | Validating schema...
49 |
50 | Following configuration errors found:
51 |
52 | * Legacy field type (name = pint and class = solr.IntField) is removed.
53 | * Legacy field type (name = plong and class = solr.LongField) is removed.
54 | * Legacy field type (name = pfloat and class = solr.FloatField) is removed.
55 | * Legacy field type (name = pdouble and class = solr.DoubleField) is removed.
56 | * Legacy field type (name = pdate and class = solr.DateField) is removed.
57 | * Legacy field type (name = sint and class = solr.SortableIntField) is removed.
58 |
59 | No configuration warnings found...
60 |
61 | Please note that in Solr 5:
62 | * Users of the BeiderMorseFilterFactory will need to rebuild their indexes after upgrading
63 |
64 | Solr schema validation failed. Please review /tmp/schema_validation.xml for more details.
65 | ```
66 |
67 | ## TODO
68 | - Add logic to handle the Solr config set (which includes overlay configurations) as well as solr.xml
69 | - Add upgrade rules to identify plugin deprecations (and removals)
70 | - Add rules for Solr 6 -> Solr 7 upgrade
71 |
72 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/solr/config/upgrade/ConfigUpgradeTool.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 | package org.apache.solr.config.upgrade;
18 |
19 | import java.nio.file.Path;
20 | import java.nio.file.Paths;
21 | import java.util.Arrays;
22 | import java.util.Comparator;
23 | import java.util.List;
24 | import java.util.Optional;
25 |
26 | import javax.xml.transform.Source;
27 | import javax.xml.transform.stream.StreamSource;
28 |
29 | import org.apache.commons.cli.CommandLine;
30 | import org.apache.commons.cli.CommandLineParser;
31 | import org.apache.commons.cli.HelpFormatter;
32 | import org.apache.commons.cli.Option;
33 | import org.apache.commons.cli.Options;
34 | import org.apache.commons.cli.ParseException;
35 | import org.apache.commons.cli.PosixParser;
36 | import org.apache.solr.config.upgrade.UpgradeProcessorsConfig.ProcessorConfig;
37 | import org.apache.solr.config.upgrade.impl.DefaultValidationResultProcessor;
38 |
39 | /**
40 | * A configuration compatibility checker tool for Solr. This tool is capable of detecting (and fixing)
41 | * compatibility errors in the Solr configuration files (specifically schema.xml, solrconfig.xml and
42 | * solr.xml).
43 | */
44 | public class ConfigUpgradeTool {
45 | private static final String HELP_CMD = "help";
46 | private static final String DRY_RUN = "dry-run";
47 | private static final String SOLR_CONF_PATH = "c";
48 | private static final String UPGRADE_PROCESSORS_CONF_FILE = "u";
49 | public static final String SOLR_CONFIG_TYPE = "t";
50 | public static final String RESULT_DIR_PATH = "d";
51 | public static final String VERBOSE_OUTPUT = "v";
52 |
53 | private static final List OPTION_HELP_ORDER = Arrays.asList(HELP_CMD, DRY_RUN,
54 | SOLR_CONF_PATH, UPGRADE_PROCESSORS_CONF_FILE, RESULT_DIR_PATH, VERBOSE_OUTPUT);
55 |
56 | public static void main(String[] args) {
57 | CommandLineParser parser = new PosixParser();
58 | Options options = new Options();
59 |
60 | options.addOption(null, DRY_RUN, false, "This command will perform compatibility checks for the specified Solr config file.");
61 | options.addOption(null, HELP_CMD, false, "This command will print the help message for the Solr config upgrade related commands.");
62 | options.addOption(UPGRADE_PROCESSORS_CONF_FILE, true, "This parameter specifies the path of the file providing Solr upgrade processor configurations.");
63 | options.addOption(SOLR_CONF_PATH, true, "This parameter specifies the path of Solr configuration to be upgraded.");
64 | options.addOption(SOLR_CONFIG_TYPE, true, "This parameter specifies the type of Solr configuration to be validated and transformed."
65 | + "The tool currently supports schema.xml, solrconfig.xml and solr.xml");
66 | options.addOption(RESULT_DIR_PATH, true,
67 | "This parameter specifies the directory path where tansformed Solr configuration should be stored.");
68 | options.addOption(VERBOSE_OUTPUT, false, "This parameter enables printing XSLT compiler warnings on the command output.");
69 |
70 | CommandLine cmd = null;
71 | try {
72 | cmd = parser.parse(options, args);
73 | if (cmd.hasOption(HELP_CMD)) {
74 | printHelp(options);
75 | } else {
76 | boolean dryRun = cmd.hasOption(DRY_RUN);
77 | Path processorConfPath = Paths.get(requiredArg(options, cmd, UPGRADE_PROCESSORS_CONF_FILE));
78 | ConfigType confType = ConfigType.getConfigType(requiredArg(options, cmd, SOLR_CONFIG_TYPE).toLowerCase());
79 | Path solrConfPath = Paths.get(requiredArg(options, cmd, SOLR_CONF_PATH));
80 | Path resultDirPath = Paths.get(requiredArg(options, cmd, RESULT_DIR_PATH));
81 | boolean verbose = cmd.hasOption(VERBOSE_OUTPUT);
82 |
83 | ToolParams params = new ToolParams(confType, solrConfPath, processorConfPath, resultDirPath, dryRun, verbose);
84 | System.exit((new ConfigUpgradeTool()).runTool(params));
85 | }
86 | } catch (ParseException e) {
87 | System.out.println(e.getLocalizedMessage());
88 | printHelp(options);
89 | System.exit(1);
90 | } catch (Exception e) {
91 | System.out.println(e.getLocalizedMessage());
92 | System.exit(1);
93 | }
94 | }
95 |
96 | /**
97 | * Invoke the compatibility checker
98 | *
99 | * @throws Exception in case of errors
100 | */
101 | public int runTool(ToolParams params) throws Exception {
102 | params.checkArgs();
103 |
104 | boolean result = true;
105 | ValidationHandler handler = new DefaultValidationResultProcessor(params);
106 | Optional validator = getConfigValidator(params);
107 | if (validator.isPresent()) {
108 | result = validator.get().validate(getConfigSource(params), handler);
109 | // Note we expect the transformation rules to be present in the validation script
110 | // at an info level. When validation script is not present, there is no need for
111 | // transformation as well.
112 | if (result && !params.isDryRun()) {
113 | Optional transformer = getConfigTransformer(params);
114 | if (transformer.isPresent()) {
115 | transformer.get().transform(getConfigSource(params));
116 | }
117 | }
118 | } else {
119 | System.out.println("No validation rules found for config type : " + params.getConfType()
120 | + " in processor configuration " + params.getProcessorConfPath() );
121 | }
122 |
123 | return result ? 0 : 1;
124 | }
125 |
126 | private Source getConfigSource(ToolParams params) {
127 | ConfigType confType = params.getConfType();
128 | switch (confType) {
129 | case SCHEMA_XML:
130 | case SOLRCONFIG_XML: {
131 | return new StreamSource(params.getSolrConfPath().toFile());
132 | }
133 |
134 | case CONFIGSET: {
135 | throw new UnsupportedOperationException();
136 | }
137 | default: {
138 | throw new UnsupportedOperationException();
139 | }
140 | }
141 | }
142 |
143 | private Optional getConfigValidator(ToolParams params) {
144 | ConfigType confType = params.getConfType();
145 | UpgradeProcessorsConfig conf = params.getUpgradeProcessorConf();
146 |
147 | switch (confType) {
148 | case SCHEMA_XML:
149 | case SOLRCONFIG_XML: {
150 | Optional procConf = conf.getProcessorByConfigType(confType);
151 | if (procConf.isPresent() && (procConf.get().getValidatorPath() != null)) {
152 | return Optional.of(new ConfigValidator(params, confType.getConfigType(), procConf.get()));
153 | }
154 | break;
155 | }
156 |
157 | case CONFIGSET: {
158 | throw new UnsupportedOperationException();
159 | }
160 | }
161 |
162 | return Optional.empty();
163 | }
164 |
165 | private Optional getConfigTransformer(ToolParams params) {
166 | ConfigType confType = params.getConfType();
167 | UpgradeProcessorsConfig conf = params.getUpgradeProcessorConf();
168 |
169 | switch (confType) {
170 | case SCHEMA_XML:
171 | case SOLRCONFIG_XML: {
172 | Optional procConf = conf.getProcessorByConfigType(confType);
173 | if (procConf.isPresent()) {
174 | return Optional.of(new ConfigTransformer(params, procConf.get()));
175 | }
176 | break;
177 | }
178 |
179 | case CONFIGSET: {
180 | throw new UnsupportedOperationException();
181 | }
182 | }
183 |
184 | return Optional.empty();
185 | }
186 |
187 | private static String requiredArg(Options options, CommandLine cmd, String optVal) {
188 | if (!cmd.hasOption(optVal)) {
189 | System.out.println("Please specify the value for option " + optVal);
190 | printHelp(options);
191 | System.exit(1);
192 | }
193 | return cmd.getOptionValue(optVal);
194 | }
195 |
196 | @SuppressWarnings({"rawtypes", "unchecked"})
197 | private static void printHelp(Options options) {
198 | StringBuilder helpFooter = new StringBuilder();
199 | helpFooter.append("Examples: \n");
200 | helpFooter.append("config_upgrade.sh -c schema.xml -t schema -u solr_4_to_5_processors.xml -d /tmp/result-dir \n");
201 | helpFooter.append("config_upgrade.sh --dry-run -c schema.xml -t schema -u solr_4_to_5_processors.xml -d /tmp/result-dir \n");
202 |
203 | HelpFormatter formatter = new HelpFormatter();
204 | formatter.setOptionComparator(new OptionComarator());
205 | formatter.printHelp("ConfigUpgradeTool", null, options, helpFooter.toString(), false);
206 | }
207 |
208 | private static class OptionComarator implements Comparator {
209 | public int compare(T o1, T o2) {
210 | String s1 = o1.hasLongOpt() ? o1.getLongOpt() : o1.getOpt();
211 | String s2 = o2.hasLongOpt() ? o2.getLongOpt() : o2.getOpt();
212 | return OPTION_HELP_ORDER.indexOf(s1) - OPTION_HELP_ORDER.indexOf(s2);
213 | }
214 | }
215 | }
216 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "{}"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright {yyyy} {name of copyright owner}
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------
/src/test/resources/bad_config/solr5/schema_2.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
31 |
32 |
33 |
49 |
50 |
51 |
85 |
86 |
92 |
93 |
96 |
97 |
98 |
101 |
102 |
103 |
107 |
108 |
109 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
156 |
157 |
158 |
161 | id
162 |
163 |
166 |
167 |
171 |
172 |
179 |
180 |
184 |
185 |
186 |
187 |
188 |
189 |
204 |
205 |
211 |
212 |
213 |
214 |
215 |
216 |
226 |
227 |
228 |
229 |
230 |
231 |
253 |
254 |
255 |
256 |
257 |
258 |
259 |
260 |
261 |
262 |
273 |
274 |
275 |
286 |
287 |
294 |
295 |
296 |
297 |
298 |
299 |
300 |
301 |
302 |
307 |
308 |
309 |
310 |
311 |
314 |
315 |
316 |
317 |
318 |
319 |
320 |
321 |
322 |
323 |
324 |
329 |
330 |
331 |
332 |
335 |
337 |
341 |
342 |
343 |
344 |
347 |
348 |
349 |
350 |
351 |
352 |
356 |
357 |
358 |
359 |
362 |
363 |
364 |
365 |
366 |
375 |
376 |
377 |
378 |
381 |
383 |
387 |
388 |
389 |
390 |
391 |
392 |
393 |
394 |
395 |
399 |
400 |
401 |
402 |
403 |
404 |
405 |
406 |
408 |
409 |
410 |
411 |
412 |
413 |
414 |
415 |
416 |
417 |
419 |
420 |
421 |
422 |
423 |
425 |
426 |
427 |
428 |
429 |
430 |
432 |
433 |
434 |
435 |
436 |
437 |
438 |
439 |
440 |
441 |
445 |
446 |
447 |
450 |
451 |
454 |
455 |
456 |
457 |
468 |
471 |
472 |
473 |
474 |
475 |
476 |
477 |
478 |
479 |
480 |
481 |
482 |
484 |
485 |
486 |
497 |
498 |
499 |
500 |
501 |
502 |
506 |
508 |
509 |
512 |
514 |
515 |
516 |
527 |
528 |
529 |
530 |
--------------------------------------------------------------------------------
/src/test/resources/bad_config/solr5/schema_1.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
31 |
32 |
33 |
49 |
50 |
51 |
85 |
86 |
92 |
93 |
96 |
97 |
98 |
101 |
102 |
103 |
107 |
108 |
109 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
156 |
157 |
158 |
161 | id
162 |
163 |
166 |
167 |
171 |
172 |
179 |
180 |
184 |
185 |
186 |
187 |
188 |
189 |
204 |
205 |
211 |
212 |
213 |
214 |
215 |
216 |
226 |
227 |
228 |
229 |
230 |
231 |
253 |
254 |
255 |
256 |
257 |
258 |
259 |
260 |
261 |
262 |
273 |
274 |
275 |
286 |
287 |
294 |
295 |
296 |
297 |
298 |
299 |
300 |
301 |
302 |
307 |
308 |
309 |
310 |
311 |
314 |
315 |
316 |
317 |
318 |
319 |
320 |
321 |
322 |
323 |
324 |
329 |
330 |
331 |
332 |
335 |
337 |
341 |
342 |
343 |
344 |
347 |
348 |
349 |
350 |
351 |
352 |
356 |
357 |
358 |
359 |
362 |
363 |
364 |
365 |
366 |
375 |
376 |
377 |
378 |
381 |
383 |
387 |
388 |
389 |
390 |
391 |
392 |
393 |
394 |
395 |
399 |
400 |
401 |
402 |
403 |
404 |
405 |
406 |
408 |
409 |
410 |
411 |
412 |
413 |
414 |
415 |
416 |
417 |
419 |
420 |
421 |
422 |
423 |
425 |
426 |
427 |
428 |
429 |
430 |
432 |
433 |
434 |
435 |
436 |
437 |
438 |
439 |
440 |
441 |
445 |
446 |
447 |
450 |
451 |
454 |
455 |
456 |
457 |
468 |
471 |
472 |
473 |
474 |
475 |
476 |
477 |
478 |
479 |
480 |
481 |
482 |
484 |
485 |
486 |
497 |
498 |
499 |
500 |
501 |
502 |
506 |
508 |
509 |
512 |
514 |
515 |
516 |
527 |
528 |
529 |
530 | false
531 |
532 |
533 |
534 |
--------------------------------------------------------------------------------
/src/test/resources/good_config/schema.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
47 |
48 |
49 |
65 |
66 |
67 |
101 |
102 |
108 |
109 |
110 |
111 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
157 |
158 |
159 |
160 |
162 |
163 |
164 |
166 |
167 |
168 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
186 |
187 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
224 |
225 |
226 |
227 |
228 |
229 |
230 |
231 |
232 |
233 |
237 |
238 |
239 |
240 |
241 |
242 |
245 | id
246 |
247 |
254 |
255 |
261 |
262 |
265 |
266 |
267 |
268 |
269 |
270 |
271 |
272 |
273 |
274 |
275 |
276 |
277 |
278 |
279 |
280 |
281 |
282 |
283 |
284 |
285 |
286 |
287 |
288 |
289 |
293 |
294 |
295 |
296 |
297 |
298 |
299 |
300 |
307 |
308 |
312 |
313 |
314 |
315 |
316 |
317 |
332 |
333 |
339 |
340 |
341 |
342 |
343 |
344 |
354 |
355 |
356 |
357 |
358 |
359 |
381 |
382 |
383 |
384 |
385 |
386 |
387 |
388 |
389 |
390 |
401 |
402 |
403 |
414 |
415 |
422 |
423 |
424 |
425 |
426 |
427 |
428 |
429 |
430 |
435 |
436 |
437 |
438 |
439 |
442 |
443 |
444 |
445 |
446 |
447 |
448 |
449 |
450 |
451 |
452 |
457 |
458 |
459 |
460 |
463 |
465 |
469 |
470 |
471 |
472 |
475 |
476 |
477 |
478 |
479 |
480 |
484 |
485 |
486 |
487 |
490 |
491 |
492 |
493 |
494 |
503 |
504 |
505 |
506 |
509 |
511 |
515 |
516 |
517 |
518 |
519 |
520 |
521 |
522 |
523 |
527 |
528 |
529 |
530 |
531 |
532 |
533 |
534 |
536 |
537 |
538 |
539 |
540 |
541 |
542 |
543 |
544 |
545 |
547 |
548 |
549 |
550 |
551 |
553 |
554 |
555 |
556 |
557 |
558 |
560 |
561 |
562 |
563 |
564 |
565 |
566 |
567 |
568 |
569 |
570 |
578 |
579 |
583 |
584 |
585 |
588 |
589 |
592 |
593 |
594 |
595 |
606 |
609 |
610 |
611 |
612 |
613 |
614 |
615 |
616 |
617 |
618 |
619 |
620 |
621 |
622 |
633 |
634 |
635 |
636 |
637 |
638 |
639 |
640 |
641 |
642 |
643 |
644 |
645 |
649 |
650 |
651 |
652 |
653 |
654 |
655 |
656 |
657 |
661 |
662 |
663 |
664 |
665 |
666 |
667 |
668 |
669 |
670 |
672 |
673 |
674 |
685 |
686 |
687 |
688 |
689 |
690 |
694 |
696 |
697 |
708 |
709 |
710 |
711 |
712 |
713 |
714 |
715 |
716 |
717 |
718 |
719 |
720 |
721 |
722 |
723 |
724 |
725 |
726 |
727 |
728 |
729 |
730 |
731 |
734 |
735 |
736 |
737 |
738 |
739 |
740 |
741 |
742 |
743 |
744 |
745 |
746 |
747 |
748 |
749 |
750 |
751 |
752 |
753 |
754 |
755 |
756 |
757 |
758 |
759 |
760 |
761 |
762 |
763 |
764 |
765 |
766 |
767 |
768 |
769 |
770 |
771 |
772 |
773 |
774 |
775 |
776 |
777 |
778 |
779 |
780 |
781 |
782 |
783 |
784 |
785 |
786 |
787 |
788 |
789 |
790 |
791 |
792 |
793 |
794 |
795 |
796 |
797 |
798 |
799 |
800 |
801 |
802 |
803 |
804 |
805 |
806 |
807 |
808 |
809 |
810 |
811 |
812 |
813 |
814 |
815 |
816 |
817 |
818 |
819 |
820 |
821 |
822 |
823 |
824 |
825 |
826 |
827 |
828 |
829 |
830 |
831 |
832 |
833 |
834 |
835 |
836 |
837 |
838 |
839 |
840 |
841 |
842 |
843 |
844 |
845 |
846 |
847 |
848 |
849 |
850 |
851 |
852 |
853 |
854 |
855 |
856 |
857 |
858 |
859 |
860 |
861 |
862 |
863 |
864 |
865 |
866 |
867 |
868 |
869 |
870 |
871 |
872 |
873 |
874 |
875 |
876 |
877 |
878 |
879 |
880 |
881 |
882 |
883 |
884 |
885 |
886 |
887 |
888 |
889 |
890 |
891 |
892 |
893 |
894 |
895 |
896 |
897 |
898 |
899 |
900 |
901 |
902 |
903 |
904 |
905 |
906 |
907 |
908 |
909 |
910 |
911 |
912 |
913 |
914 |
915 |
916 |
917 |
918 |
919 |
920 |
921 |
922 |
923 |
924 |
925 |
926 |
927 |
928 |
929 |
930 |
931 |
932 |
933 |
934 |
935 |
936 |
937 |
938 |
939 |
940 |
941 |
942 |
943 |
944 |
945 |
946 |
947 |
948 |
949 |
950 |
951 |
952 |
953 |
954 |
955 |
956 |
957 |
958 |
959 |
965 |
966 |
967 |
995 |
996 |
997 |
998 |
999 |
1000 |
1001 |
1002 |
1003 |
1004 |
1005 |
1006 |
1007 |
1008 |
1009 |
1010 |
1011 |
1012 |
1013 |
1014 |
1015 |
1016 |
1017 |
1018 |
1019 |
1020 |
1021 |
1022 |
1023 |
1024 |
1025 |
1026 |
1027 |
1028 |
1029 |
1030 |
1031 |
1032 |
1033 |
1034 |
1035 |
1036 |
1037 |
1038 |
1039 |
1040 |
1041 |
1042 |
1043 |
1044 |
1045 |
1046 |
1047 |
1048 |
1049 |
1050 |
1051 |
1052 |
1053 |
1054 |
1055 |
1056 |
1057 |
1058 |
1059 |
1060 |
1061 |
1062 |
1063 |
1064 |
1065 |
1066 |
1067 |
1068 |
1069 |
1070 |
1071 |
1072 |
1073 |
1074 |
1075 |
1076 |
1077 |
1078 |
1079 |
1080 |
1081 |
1082 |
1083 |
1084 |
1085 |
1086 |
1087 |
1088 |
1089 |
1090 |
1091 |
1092 |
1093 |
1094 |
1095 |
1096 |
1097 |
1098 |
1099 |
1100 |
1101 |
1102 |
1103 |
1104 |
1105 |
1106 |
1107 |
1108 |
1109 |
1110 |
1111 |
1112 |
1113 |
1118 |
1123 |
1124 |
1125 |
--------------------------------------------------------------------------------