Skip to content

Commit

Permalink
remote Solr dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
baisui1981 committed Dec 22, 2021
1 parent 93f57a4 commit 190c369
Show file tree
Hide file tree
Showing 14 changed files with 1,265 additions and 1,265 deletions.
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.qlangtech.tis.exec.impl;

import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.qlangtech.tis.TisZkClient;
import com.qlangtech.tis.assemble.FullbuildPhase;
import com.qlangtech.tis.cloud.ITISCoordinator;
import com.qlangtech.tis.exec.ExecChainContextUtils;
import com.qlangtech.tis.exec.ExecutePhaseRange;
import com.qlangtech.tis.exec.IExecChainContext;
//import com.qlangtech.tis.exec.IIndexMetaData;
import com.qlangtech.tis.fs.ITISFileSystem;
import com.qlangtech.tis.fullbuild.IFullBuildContext;
import com.qlangtech.tis.fullbuild.phasestatus.PhaseStatusCollection;
Expand All @@ -41,11 +41,12 @@
import com.qlangtech.tis.sql.parser.TabPartitions;
import com.qlangtech.tis.workflow.pojo.WorkFlowBuildHistory;
import org.apache.commons.lang.StringUtils;
import org.apache.solr.common.cloud.ZkStateReader;

import java.time.LocalDateTime;
import java.util.*;

//import com.qlangtech.tis.exec.IIndexMetaData;

/**
* @author 百岁([email protected]
* @date 2015年12月15日 下午4:39:38
Expand All @@ -54,7 +55,7 @@ public class DefaultChainContext implements IExecChainContext {

private String ps;

private TisZkClient zkClient;
private ITISCoordinator zkClient;

private ITISFileSystem indexBuildFileSystem;

Expand Down Expand Up @@ -136,7 +137,7 @@ public void setTableDumpFactory(TableDumpFactory factory) {
// }

//public void setIndexMetaData(IIndexMetaData indexMetaData) {
// this.indexMetaData = indexMetaData;
// this.indexMetaData = indexMetaData;
//}

@Override
Expand Down Expand Up @@ -207,14 +208,14 @@ public <T> T getAttribute(String key) {
// }

@Override
public TisZkClient getZkClient() {
public ITISCoordinator getZkClient() {
if (this.zkClient == null) {
throw new NullPointerException("zkClient can not null");
}
return this.zkClient;
}

public void setZkClient(TisZkClient zkClient) {
public void setZkClient(ITISCoordinator zkClient) {
this.zkClient = zkClient;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ public ExecuteResult startWork(DefaultChainContext chainContext) throws Exceptio
ExecutePhaseRange range = chainContext.getExecutePhaseRange();
logger.info("start component:" + range.getStart() + ",end component:" + range.getEnd());
// chainContext.setZkClient(zkClient);
chainContext.setZkClient(null);
chainContext.setZkClient(this.zkClient);
// chainContext.setZkStateReader(zkStateReader);
// Objects.requireNonNull(chainContext.getIndexBuildFileSystem(), "IndexBuildFileSystem of chainContext can not be null");
// Objects.requireNonNull(chainContext.getTableDumpFactory(), "tableDumpFactory of chainContext can not be null");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.qlangtech.tis.config.module.action;

Expand Down Expand Up @@ -46,7 +46,6 @@
import com.qlangtech.tis.solrdao.SolrFieldsParser;
import com.qlangtech.tis.solrdao.impl.ParseResult;
import com.qlangtech.tis.solrdao.pojo.PSchemaField;
import com.qlangtech.tis.solrj.extend.AbstractTisCloudSolrClient;
import com.qlangtech.tis.sql.parser.SqlTaskNodeMeta;
import com.qlangtech.tis.workflow.dao.IWorkflowDAOFacade;
import com.qlangtech.tis.workflow.pojo.DatasourceDbCriteria;
Expand Down Expand Up @@ -82,7 +81,7 @@ public class TestCollectionAction extends BasicActionTestCase {

static {

// AbstractTisCloudSolrClient.initHashcodeRouter();
// AbstractTisCloudSolrClient.initHashcodeRouter();

// stub create collection
HttpUtils.addMockApply(CoreAction.CREATE_COLLECTION_PATH, (url) -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,20 @@
*/
public class AddSolrDocument extends TestCase {

private TisCloudSolrClient client;
// private TisCloudSolrClient client;

public void setUp() throws Exception {
super.setUp();
String zkHost = "10.1.6.65:2181,10.1.6.67:2181,10.1.6.80:2181/tis/cloud";
client = new TisCloudSolrClient(zkHost);
// client = new TisCloudSolrClient(zkHost);
}

public void tearDown() throws Exception {
super.tearDown();
}

private void add(SolrInputDocument doc) throws SolrServerException {
client.add("search4supplyUnionTabs", doc, 1L);
//client.add("search4supplyUnionTabs", doc, 1L);
}

private String getFile() throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public abstract class BasicTestCase extends TestCase {
// AbstractTisCloudSolrClient.initHashcodeRouter();
}

protected TisCloudSolrClient client = null;
// protected TisCloudSolrClient client = null;

protected SolrQuery query = null;

Expand Down Expand Up @@ -57,10 +57,10 @@ protected void setUp() throws Exception {
// public TisCloudSolrClient(String zkHost //
// , int socketTimeout, int connTimeout, int maxConnectionsPerHost, int
// maxConnections) {
client = new TisCloudSolrClient(zkHost, 5000, /* socketTimeout */
5000, /* connTimeout */
20, /* maxConnectionsPerHost */
100);
// client = new TisCloudSolrClient(zkHost, 5000, /* socketTimeout */
// 5000, /* connTimeout */
// 20, /* maxConnectionsPerHost */
// 100);
query = new SolrQuery();
start = System.currentTimeMillis();
}
Expand Down
Loading

0 comments on commit 190c369

Please sign in to comment.