Skip to content

Commit

Permalink
java client conform to apache style
Browse files Browse the repository at this point in the history
  • Loading branch information
olivertang committed May 7, 2022
1 parent 7af817b commit c2ded94
Show file tree
Hide file tree
Showing 215 changed files with 17,631 additions and 12,378 deletions.
37 changes: 0 additions & 37 deletions .github/workflows/ci-issue.yaml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@
# under the License.
#

name: CI - License
name: License Check - java client
on:
pull_request:
branches:
- master
paths:
- java-client/**

jobs:
license-check:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,17 @@
# under the License.
#

name: CI - Test
name: Test - java client
on:
pull_request:
branches:
- master
- 'v[0-9]+.*' # release branch
- ci-test # testing branch for github action
- '*dev' # developing branch
paths:
- java-client/**

workflow_dispatch:

defaults:
Expand Down
23 changes: 22 additions & 1 deletion java-client/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
<!--
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.
-->

# Pegasus Java Client

[![Build Status](https://travis-ci.org/XiaoMi/pegasus-java-client.svg?branch=thrift-0.11.0-inlined)](https://travis-ci.org/XiaoMi/pegasus-java-client)
Expand Down Expand Up @@ -72,7 +91,9 @@ For each type of request(get, set, multiset, etc.), we collect 8 metrics:

We use io.dropwizard.metrics library to calculate the request count.

Currently, metrics are integrated with open-falcon(http://open-falcon.com/),
Currently, metrics are integrated with open-falcon(https://open-falcon.org/),
<!-- markdown-link-check-disable -->
which push counters to local http agent http://127.0.0.1:1988/push/v1.
<!-- markdown-link-check-enable-->

If you'd like to integrate pegasus client with other monitor system, please let us know ASAP.
21 changes: 20 additions & 1 deletion java-client/configuration/log4j.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
#
# 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.
#

log4j.rootLogger=DEBUG, rolling_file
log4j.logger.com.xiaomi.infra.pegasus = INFO
log4j.logger.org.apache.pegasus = INFO

log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
Expand Down
19 changes: 19 additions & 0 deletions java-client/configuration/pegasus.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
#
# 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.
#

meta_servers = 127.0.0.1:34601,127.0.0.1:34602,127.0.0.1:34603
operation_timeout = 5000
async_workers = 4
Expand Down
19 changes: 19 additions & 0 deletions java-client/dev-support/checkstyle-suppressions.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,23 @@
<?xml version="1.0"?>
<!--
~ 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.
-->

<!DOCTYPE suppressions PUBLIC
"-//Puppy Crawl//DTD Suppressions 1.0//EN"
"http://www.puppycrawl.com/dtds/suppressions_1_0.dtd">
Expand Down
37 changes: 28 additions & 9 deletions java-client/dev-support/findbugs-exclude.xml
Original file line number Diff line number Diff line change
@@ -1,22 +1,41 @@
<!--
~ 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.
-->

<FindBugsFilter>

<Match>
<Or>
<!-- thrift generated files -->
<Package name="com.xiaomi.infra.pegasus.apps"/>
<Package name="com.xiaomi.infra.pegasus.base"/>
<Package name="com.xiaomi.infra.pegasus.replication"/>
<Package name="org.apache.pegasus.apps"/>
<Package name="org.apache.pegasus.base"/>
<Package name="org.apache.pegasus.replication"/>

<!--
TODO(wutao1): The following packages should be removed from
the exclusion list after their bugs are fixed.
-->
<Package name="com.xiaomi.infra.pegasus.rpc.async"/>
<Package name="com.xiaomi.infra.pegasus.client"/>
<Package name="com.xiaomi.infra.pegasus.metrics"/>
<Package name="com.xiaomi.infra.pegasus.tools"/>
<Package name="com.xiaomi.infra.pegasus.client.request"/>
<Package name="com.xiaomi.infra.pegasus.example"/>
<Package name="org.apache.pegasus.rpc.async"/>
<Package name="org.apache.pegasus.client"/>
<Package name="org.apache.pegasus.metrics"/>
<Package name="org.apache.pegasus.tools"/>
<Package name="org.apache.pegasus.client.request"/>
<Package name="org.apache.pegasus.example"/>
</Or>
</Match>

Expand Down
19 changes: 19 additions & 0 deletions java-client/dev-support/google-checks.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,23 @@
<?xml version="1.0"?>
<!--
~ 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.
-->

<!DOCTYPE module PUBLIC
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
"https://checkstyle.org/dtds/configuration_1_3.dtd">
Expand Down
34 changes: 18 additions & 16 deletions java-client/idl/apache-licence-template
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
// 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
*
* 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.
*/
20 changes: 19 additions & 1 deletion java-client/idl/base.thrift
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
/*
* 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.
*/
namespace cpp dsn.base
namespace java com.xiaomi.infra.pegasus.base
namespace java org.apache.pegasus.base
namespace py pypegasus.base

// place holder
Expand Down
3 changes: 1 addition & 2 deletions java-client/idl/meta_admin.thrift
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,10 @@
* specific language governing permissions and limitations
* under the License.
*/

include "base.thrift"

namespace cpp dsn.replication
namespace java com.xiaomi.infra.pegasus.replication
namespace java org.apache.pegasus.replication

struct create_app_options
{
Expand Down
19 changes: 19 additions & 0 deletions java-client/idl/recompile_thrift.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
#!/bin/bash

#
# 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.
#

# method to get thrift 0.11.0:
# wget http://mirrors.tuna.tsinghua.edu.cn/apache/thrift/0.11.0/thrift-0.11.0.tar.gz
# tar xvf thrift-0.11.0.tar.gz
Expand Down
20 changes: 19 additions & 1 deletion java-client/idl/replication.thrift
Original file line number Diff line number Diff line change
@@ -1,7 +1,25 @@
/*
* 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.
*/
include "base.thrift"

namespace cpp dsn.replication
namespace java com.xiaomi.infra.pegasus.replication
namespace java org.apache.pegasus.replication
namespace py pypegasus.replication

struct partition_configuration
Expand Down
Loading

0 comments on commit c2ded94

Please sign in to comment.