This commit is contained in:
parent
eb2644fd37
commit
f36556657f
@ -18,6 +18,8 @@ package com.alibaba.nacos.common.utils;
|
|||||||
|
|
||||||
import com.alibaba.nacos.api.exception.runtime.NacosRuntimeException;
|
import com.alibaba.nacos.api.exception.runtime.NacosRuntimeException;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
import static com.alibaba.nacos.api.exception.NacosException.SERVER_ERROR;
|
import static com.alibaba.nacos.api.exception.NacosException.SERVER_ERROR;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -18,6 +18,7 @@ package com.alibaba.nacos.common.utils;
|
|||||||
|
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.PrintStream;
|
import java.io.PrintStream;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Common methods for exception.
|
* Common methods for exception.
|
||||||
|
@ -21,6 +21,7 @@ import com.alibaba.nacos.common.NotThreadSafe;
|
|||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Dictionary;
|
import java.util.Dictionary;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.function.Predicate;
|
import java.util.function.Predicate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,214 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 1999-2018 Alibaba Group Holding Ltd.
|
|
||||||
*
|
|
||||||
* Licensed 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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.alibaba.nacos.common.utils;
|
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.Comparator;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Objects utils.
|
|
||||||
*
|
|
||||||
* @author <a href="mailto:liaochuntao@live.com">liaochuntao</a>
|
|
||||||
*/
|
|
||||||
@SuppressWarnings("PMD.RemoveCommentedCodeRule")
|
|
||||||
public class Objects {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns {@code true} if the arguments are equal to each other and {@code false} otherwise. Consequently, if both
|
|
||||||
* arguments are {@code null}, {@code true} is returned and if exactly one argument is {@code null}, {@code false}
|
|
||||||
* is returned. Otherwise, equality is determined by using the {@link Object#equals equals} method of the first
|
|
||||||
* argument.
|
|
||||||
*
|
|
||||||
* @param a an object
|
|
||||||
* @param b an object to be compared with {@code a} for equality
|
|
||||||
* @return {@code true} if the arguments are equal to each other and {@code false} otherwise
|
|
||||||
* @see Object#equals(Object)
|
|
||||||
*/
|
|
||||||
public static boolean equals(Object a, Object b) {
|
|
||||||
return (a == b) || (a != null && a.equals(b));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the hash code of a non-{@code null} argument and 0 for a {@code null} argument.
|
|
||||||
*
|
|
||||||
* @param o an object
|
|
||||||
* @return the hash code of a non-{@code null} argument and 0 for a {@code null} argument
|
|
||||||
* @see Object#hashCode
|
|
||||||
*/
|
|
||||||
public static int hashCode(Object o) {
|
|
||||||
return o != null ? o.hashCode() : 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Generates a hash code for a sequence of input values. The hash code is generated as if all the input values were
|
|
||||||
* placed into an array, and that array were hashed by calling {@link Arrays#hashCode(Object[])}.
|
|
||||||
*
|
|
||||||
* <p>This method is useful for implementing {@link
|
|
||||||
* Object#hashCode()} on objects containing multiple fields. For example, if an object that has three fields, {@code
|
|
||||||
* x}, {@code y}, and {@code z}, one could write:
|
|
||||||
*
|
|
||||||
* <blockquote><pre>
|
|
||||||
* @Override
|
|
||||||
* public int hashCode() {
|
|
||||||
* return Objects.hash(x, y, z);
|
|
||||||
* }
|
|
||||||
* </pre></blockquote>
|
|
||||||
*
|
|
||||||
* <b>Warning: When a single object reference is supplied, the returned
|
|
||||||
* value does not equal the hash code of that object reference.</b> This value can be computed by calling {@link
|
|
||||||
* #hashCode(Object)}.
|
|
||||||
*
|
|
||||||
* @param values the values to be hashed
|
|
||||||
* @return a hash value of the sequence of input values
|
|
||||||
* @see Arrays#hashCode(Object[])
|
|
||||||
* @see List#hashCode
|
|
||||||
*/
|
|
||||||
public static int hash(Object... values) {
|
|
||||||
return Arrays.hashCode(values);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the result of calling {@code toString} for a non-{@code null} argument and {@code "null"} for a {@code
|
|
||||||
* null} argument.
|
|
||||||
*
|
|
||||||
* @param o an object
|
|
||||||
* @return the result of calling {@code toString} for a non-{@code null} argument and {@code "null"} for a {@code
|
|
||||||
* null} argument
|
|
||||||
* @see Object#toString
|
|
||||||
* @see String#valueOf(Object)
|
|
||||||
*/
|
|
||||||
public static String toString(Object o) {
|
|
||||||
return String.valueOf(o);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the result of calling {@code toString} on the first argument if the first argument is not {@code null}
|
|
||||||
* and returns the second argument otherwise.
|
|
||||||
*
|
|
||||||
* @param o an object
|
|
||||||
* @param nullDefault string to return if the first argument is {@code null}
|
|
||||||
* @return the result of calling {@code toString} on the first argument if it is not {@code null} and the second
|
|
||||||
* argument otherwise.
|
|
||||||
*/
|
|
||||||
public static String toString(Object o, String nullDefault) {
|
|
||||||
return (o != null) ? o.toString() : nullDefault;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns 0 if the arguments are identical and {@code c.compare(a, b)} otherwise. Consequently, if both arguments
|
|
||||||
* are {@code null} 0 is returned.
|
|
||||||
*
|
|
||||||
* <p>Note that if one of the arguments is {@code null}, a {@code
|
|
||||||
* NullPointerException} may or may not be thrown depending on what ordering policy, if any, the {@link Comparator
|
|
||||||
* Comparator} chooses to have for {@code null} values.
|
|
||||||
*
|
|
||||||
* @param <T> the type of the objects being compared
|
|
||||||
* @param a an object
|
|
||||||
* @param b an object to be compared with {@code a}
|
|
||||||
* @param c the {@code Comparator} to compare the first two arguments
|
|
||||||
* @return 0 if the arguments are identical and {@code c.compare(a, b)} otherwise.
|
|
||||||
* @see Comparable
|
|
||||||
* @see Comparator
|
|
||||||
*/
|
|
||||||
public static <T> int compare(T a, T b, Comparator<? super T> c) {
|
|
||||||
return (a == b) ? 0 : c.compare(a, b);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Checks that the specified object reference is not {@code null}. This method is designed primarily for doing
|
|
||||||
* parameter validation in methods and constructors, as demonstrated below:
|
|
||||||
* <blockquote><pre>
|
|
||||||
* public Foo(Bar bar) {
|
|
||||||
* this.bar = Objects.requireNonNull(bar);
|
|
||||||
* }
|
|
||||||
* </pre></blockquote>
|
|
||||||
*
|
|
||||||
* @param obj the object reference to check for nullity
|
|
||||||
* @param <T> the type of the reference
|
|
||||||
* @return {@code obj} if not {@code null}
|
|
||||||
* @throws NullPointerException if {@code obj} is {@code null}
|
|
||||||
*/
|
|
||||||
public static <T> T requireNonNull(T obj) {
|
|
||||||
if (obj == null) {
|
|
||||||
throw new NullPointerException();
|
|
||||||
}
|
|
||||||
return obj;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Checks that the specified object reference is not {@code null} and throws a customized {@link
|
|
||||||
* NullPointerException} if it is. This method is designed primarily for doing parameter validation in methods and
|
|
||||||
* constructors with multiple parameters, as demonstrated below:
|
|
||||||
* <blockquote><pre>
|
|
||||||
* public Foo(Bar bar, Baz baz) {
|
|
||||||
* this.bar = Objects.requireNonNull(bar, "bar must not be null");
|
|
||||||
* this.baz = Objects.requireNonNull(baz, "baz must not be null");
|
|
||||||
* }
|
|
||||||
* </pre></blockquote>
|
|
||||||
*
|
|
||||||
* @param obj the object reference to check for nullity
|
|
||||||
* @param message detail message to be used in the event that a {@code NullPointerException} is thrown
|
|
||||||
* @param <T> the type of the reference
|
|
||||||
* @return {@code obj} if not {@code null}
|
|
||||||
* @throws NullPointerException if {@code obj} is {@code null}
|
|
||||||
*/
|
|
||||||
public static <T> T requireNonNull(T obj, String message) {
|
|
||||||
if (obj == null) {
|
|
||||||
throw new NullPointerException(message);
|
|
||||||
}
|
|
||||||
return obj;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns {@code true} if the provided reference is {@code null} otherwise returns {@code false}.
|
|
||||||
*
|
|
||||||
* @param obj a reference to be checked against {@code null}
|
|
||||||
* @return {@code true} if the provided reference is {@code null} otherwise {@code false}
|
|
||||||
* @apiNote This method exists to be used as a
|
|
||||||
* @since 1.8
|
|
||||||
*/
|
|
||||||
public static boolean isNull(Object obj) {
|
|
||||||
return obj == null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns {@code true} if the provided reference is non-{@code null} otherwise returns {@code false}.
|
|
||||||
*
|
|
||||||
* @param obj a reference to be checked against {@code null}
|
|
||||||
* @return {@code true} if the provided reference is non-{@code null} otherwise {@code false}
|
|
||||||
* @apiNote This method exists to be used as a
|
|
||||||
* @since 1.8
|
|
||||||
*/
|
|
||||||
public static boolean nonNull(Object obj) {
|
|
||||||
return obj != null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the first argument if it is non-{@code null} and otherwise returns the non-{@code null} second argument.
|
|
||||||
*
|
|
||||||
* @param obj an object
|
|
||||||
* @param defaultObj a non-{@code null} object to return if the first argument is {@code null}
|
|
||||||
* @param <T> the type of the reference
|
|
||||||
* @return the first argument if it is non-{@code null} and otherwise the second argument if it is non-{@code null}
|
|
||||||
* @throws NullPointerException if both {@code obj} is null and {@code defaultObj} is {@code null}
|
|
||||||
* @since 9
|
|
||||||
*/
|
|
||||||
public static <T> T requireNonNullElse(T obj, T defaultObj) {
|
|
||||||
return (obj != null) ? obj : requireNonNull(defaultObj, "defaultObj");
|
|
||||||
}
|
|
||||||
}
|
|
@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
package com.alibaba.nacos.common.utils;
|
package com.alibaba.nacos.common.utils;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -18,6 +18,7 @@ package com.alibaba.nacos.common.utils;
|
|||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.concurrent.CountDownLatch;
|
import java.util.concurrent.CountDownLatch;
|
||||||
import java.util.concurrent.ExecutorService;
|
import java.util.concurrent.ExecutorService;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
@ -18,6 +18,7 @@ package com.alibaba.nacos.common.utils;
|
|||||||
|
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -20,7 +20,6 @@ import com.alibaba.nacos.auth.annotation.Secured;
|
|||||||
import com.alibaba.nacos.auth.common.ActionTypes;
|
import com.alibaba.nacos.auth.common.ActionTypes;
|
||||||
import com.alibaba.nacos.common.model.RestResult;
|
import com.alibaba.nacos.common.model.RestResult;
|
||||||
import com.alibaba.nacos.common.model.RestResultUtils;
|
import com.alibaba.nacos.common.model.RestResultUtils;
|
||||||
import com.alibaba.nacos.common.utils.Objects;
|
|
||||||
import com.alibaba.nacos.common.notify.NotifyCenter;
|
import com.alibaba.nacos.common.notify.NotifyCenter;
|
||||||
import com.alibaba.nacos.config.server.constant.Constants;
|
import com.alibaba.nacos.config.server.constant.Constants;
|
||||||
import com.alibaba.nacos.config.server.model.event.DerbyImportEvent;
|
import com.alibaba.nacos.config.server.model.event.DerbyImportEvent;
|
||||||
@ -31,8 +30,8 @@ import com.alibaba.nacos.config.server.service.repository.PersistService;
|
|||||||
import com.alibaba.nacos.config.server.service.repository.embedded.DatabaseOperate;
|
import com.alibaba.nacos.config.server.service.repository.embedded.DatabaseOperate;
|
||||||
import com.alibaba.nacos.config.server.utils.LogUtil;
|
import com.alibaba.nacos.config.server.utils.LogUtil;
|
||||||
import com.alibaba.nacos.config.server.utils.PropertyUtil;
|
import com.alibaba.nacos.config.server.utils.PropertyUtil;
|
||||||
import com.alibaba.nacos.sys.utils.ApplicationUtils;
|
|
||||||
import com.alibaba.nacos.core.utils.WebUtils;
|
import com.alibaba.nacos.core.utils.WebUtils;
|
||||||
|
import com.alibaba.nacos.sys.utils.ApplicationUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
@ -50,6 +49,7 @@ import org.springframework.web.multipart.MultipartFile;
|
|||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Manage controllers.
|
* Manage controllers.
|
||||||
|
@ -19,7 +19,6 @@ package com.alibaba.nacos.config.server.controller;
|
|||||||
import com.alibaba.nacos.auth.annotation.Secured;
|
import com.alibaba.nacos.auth.annotation.Secured;
|
||||||
import com.alibaba.nacos.auth.common.ActionTypes;
|
import com.alibaba.nacos.auth.common.ActionTypes;
|
||||||
import com.alibaba.nacos.auth.exception.AccessException;
|
import com.alibaba.nacos.auth.exception.AccessException;
|
||||||
import com.alibaba.nacos.common.utils.Objects;
|
|
||||||
import com.alibaba.nacos.config.server.auth.ConfigResourceParser;
|
import com.alibaba.nacos.config.server.auth.ConfigResourceParser;
|
||||||
import com.alibaba.nacos.config.server.constant.Constants;
|
import com.alibaba.nacos.config.server.constant.Constants;
|
||||||
import com.alibaba.nacos.config.server.model.ConfigHistoryInfo;
|
import com.alibaba.nacos.config.server.model.ConfigHistoryInfo;
|
||||||
@ -33,6 +32,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* History management controller.
|
* History management controller.
|
||||||
*
|
*
|
||||||
|
@ -25,7 +25,6 @@ import com.alibaba.nacos.auth.exception.AccessException;
|
|||||||
import com.alibaba.nacos.common.model.RestResult;
|
import com.alibaba.nacos.common.model.RestResult;
|
||||||
import com.alibaba.nacos.common.model.RestResultUtils;
|
import com.alibaba.nacos.common.model.RestResultUtils;
|
||||||
import com.alibaba.nacos.common.utils.JacksonUtils;
|
import com.alibaba.nacos.common.utils.JacksonUtils;
|
||||||
import com.alibaba.nacos.common.utils.Objects;
|
|
||||||
import com.alibaba.nacos.config.server.auth.RoleInfo;
|
import com.alibaba.nacos.config.server.auth.RoleInfo;
|
||||||
import com.alibaba.nacos.config.server.model.User;
|
import com.alibaba.nacos.config.server.model.User;
|
||||||
import com.alibaba.nacos.config.server.utils.RequestUtil;
|
import com.alibaba.nacos.config.server.utils.RequestUtil;
|
||||||
@ -57,6 +56,7 @@ import javax.servlet.http.HttpServletRequest;
|
|||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* User related methods entry.
|
* User related methods entry.
|
||||||
|
@ -18,7 +18,6 @@ package com.alibaba.nacos.core.cluster;
|
|||||||
|
|
||||||
import com.alibaba.nacos.common.utils.ExceptionUtil;
|
import com.alibaba.nacos.common.utils.ExceptionUtil;
|
||||||
import com.alibaba.nacos.common.utils.InternetAddressUtil;
|
import com.alibaba.nacos.common.utils.InternetAddressUtil;
|
||||||
import com.alibaba.nacos.common.utils.Objects;
|
|
||||||
import com.alibaba.nacos.core.utils.Loggers;
|
import com.alibaba.nacos.core.utils.Loggers;
|
||||||
import com.alibaba.nacos.sys.env.EnvUtil;
|
import com.alibaba.nacos.sys.env.EnvUtil;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
@ -30,6 +29,7 @@ import java.util.HashMap;
|
|||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.concurrent.ThreadLocalRandom;
|
import java.util.concurrent.ThreadLocalRandom;
|
||||||
import java.util.function.Predicate;
|
import java.util.function.Predicate;
|
||||||
|
@ -16,11 +16,11 @@
|
|||||||
|
|
||||||
package com.alibaba.nacos.core.distributed.raft.utils;
|
package com.alibaba.nacos.core.distributed.raft.utils;
|
||||||
|
|
||||||
import com.alibaba.nacos.common.utils.Objects;
|
|
||||||
import com.alibaba.nacos.consistency.entity.Response;
|
import com.alibaba.nacos.consistency.entity.Response;
|
||||||
import com.alibaba.nacos.consistency.exception.ConsistencyException;
|
import com.alibaba.nacos.consistency.exception.ConsistencyException;
|
||||||
import com.alipay.sofa.jraft.Status;
|
import com.alipay.sofa.jraft.Status;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -16,7 +16,6 @@
|
|||||||
|
|
||||||
package com.alibaba.nacos.core.remote.control;
|
package com.alibaba.nacos.core.remote.control;
|
||||||
|
|
||||||
import com.alibaba.nacos.common.utils.Objects;
|
|
||||||
import com.alibaba.nacos.core.utils.Loggers;
|
import com.alibaba.nacos.core.utils.Loggers;
|
||||||
|
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
@ -26,6 +25,7 @@ import java.util.HashMap;
|
|||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -18,7 +18,6 @@ package com.alibaba.nacos.naming.consistency.ephemeral.distro;
|
|||||||
|
|
||||||
import com.alibaba.nacos.api.common.Constants;
|
import com.alibaba.nacos.api.common.Constants;
|
||||||
import com.alibaba.nacos.api.exception.NacosException;
|
import com.alibaba.nacos.api.exception.NacosException;
|
||||||
import com.alibaba.nacos.common.utils.Objects;
|
|
||||||
import com.alibaba.nacos.consistency.DataOperation;
|
import com.alibaba.nacos.consistency.DataOperation;
|
||||||
import com.alibaba.nacos.core.distributed.distro.DistroConfig;
|
import com.alibaba.nacos.core.distributed.distro.DistroConfig;
|
||||||
import com.alibaba.nacos.core.distributed.distro.DistroProtocol;
|
import com.alibaba.nacos.core.distributed.distro.DistroProtocol;
|
||||||
@ -50,6 +49,7 @@ import javax.annotation.PostConstruct;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.concurrent.ArrayBlockingQueue;
|
import java.util.concurrent.ArrayBlockingQueue;
|
||||||
import java.util.concurrent.BlockingQueue;
|
import java.util.concurrent.BlockingQueue;
|
||||||
|
@ -16,7 +16,6 @@
|
|||||||
|
|
||||||
package com.alibaba.nacos.naming.consistency.persistent.impl;
|
package com.alibaba.nacos.naming.consistency.persistent.impl;
|
||||||
|
|
||||||
import com.alibaba.nacos.common.utils.Objects;
|
|
||||||
import com.alibaba.nacos.consistency.snapshot.LocalFileMeta;
|
import com.alibaba.nacos.consistency.snapshot.LocalFileMeta;
|
||||||
import com.alibaba.nacos.consistency.snapshot.Reader;
|
import com.alibaba.nacos.consistency.snapshot.Reader;
|
||||||
import com.alibaba.nacos.consistency.snapshot.Writer;
|
import com.alibaba.nacos.consistency.snapshot.Writer;
|
||||||
@ -26,6 +25,7 @@ import com.alibaba.nacos.sys.utils.DiskUtils;
|
|||||||
import com.alipay.sofa.jraft.util.CRC64;
|
import com.alipay.sofa.jraft.util.CRC64;
|
||||||
|
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
||||||
import java.util.zip.Checksum;
|
import java.util.zip.Checksum;
|
||||||
|
|
||||||
|
@ -21,7 +21,6 @@ import com.alibaba.nacos.api.exception.NacosException;
|
|||||||
import com.alibaba.nacos.api.naming.utils.NamingUtils;
|
import com.alibaba.nacos.api.naming.utils.NamingUtils;
|
||||||
import com.alibaba.nacos.common.utils.InternetAddressUtil;
|
import com.alibaba.nacos.common.utils.InternetAddressUtil;
|
||||||
import com.alibaba.nacos.common.utils.JacksonUtils;
|
import com.alibaba.nacos.common.utils.JacksonUtils;
|
||||||
import com.alibaba.nacos.common.utils.Objects;
|
|
||||||
import com.alibaba.nacos.core.cluster.Member;
|
import com.alibaba.nacos.core.cluster.Member;
|
||||||
import com.alibaba.nacos.core.cluster.ServerMemberManager;
|
import com.alibaba.nacos.core.cluster.ServerMemberManager;
|
||||||
import com.alibaba.nacos.naming.consistency.ConsistencyService;
|
import com.alibaba.nacos.naming.consistency.ConsistencyService;
|
||||||
@ -60,6 +59,7 @@ import java.util.HashSet;
|
|||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.StringJoiner;
|
import java.util.StringJoiner;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
@ -16,7 +16,6 @@
|
|||||||
|
|
||||||
package com.alibaba.nacos.naming.core.v2.metadata;
|
package com.alibaba.nacos.naming.core.v2.metadata;
|
||||||
|
|
||||||
import com.alibaba.nacos.common.utils.Objects;
|
|
||||||
import com.alibaba.nacos.consistency.snapshot.LocalFileMeta;
|
import com.alibaba.nacos.consistency.snapshot.LocalFileMeta;
|
||||||
import com.alibaba.nacos.consistency.snapshot.Reader;
|
import com.alibaba.nacos.consistency.snapshot.Reader;
|
||||||
import com.alibaba.nacos.consistency.snapshot.Writer;
|
import com.alibaba.nacos.consistency.snapshot.Writer;
|
||||||
@ -27,6 +26,7 @@ import com.alipay.sofa.jraft.util.CRC64;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
||||||
import java.util.zip.Checksum;
|
import java.util.zip.Checksum;
|
||||||
|
|
||||||
|
@ -21,7 +21,6 @@ import com.alibaba.nacos.api.exception.runtime.NacosRuntimeException;
|
|||||||
import com.alibaba.nacos.api.naming.pojo.Instance;
|
import com.alibaba.nacos.api.naming.pojo.Instance;
|
||||||
import com.alibaba.nacos.common.notify.NotifyCenter;
|
import com.alibaba.nacos.common.notify.NotifyCenter;
|
||||||
import com.alibaba.nacos.common.utils.ClassUtils;
|
import com.alibaba.nacos.common.utils.ClassUtils;
|
||||||
import com.alibaba.nacos.common.utils.Objects;
|
|
||||||
import com.alibaba.nacos.consistency.DataOperation;
|
import com.alibaba.nacos.consistency.DataOperation;
|
||||||
import com.alibaba.nacos.consistency.SerializeFactory;
|
import com.alibaba.nacos.consistency.SerializeFactory;
|
||||||
import com.alibaba.nacos.consistency.Serializer;
|
import com.alibaba.nacos.consistency.Serializer;
|
||||||
@ -36,6 +35,7 @@ import com.alibaba.nacos.consistency.snapshot.SnapshotOperation;
|
|||||||
import com.alibaba.nacos.consistency.snapshot.Writer;
|
import com.alibaba.nacos.consistency.snapshot.Writer;
|
||||||
import com.alibaba.nacos.core.distributed.ProtocolManager;
|
import com.alibaba.nacos.core.distributed.ProtocolManager;
|
||||||
import com.alibaba.nacos.naming.consistency.persistent.impl.AbstractSnapshotOperation;
|
import com.alibaba.nacos.naming.consistency.persistent.impl.AbstractSnapshotOperation;
|
||||||
|
import com.alibaba.nacos.naming.constants.Constants;
|
||||||
import com.alibaba.nacos.naming.core.v2.ServiceManager;
|
import com.alibaba.nacos.naming.core.v2.ServiceManager;
|
||||||
import com.alibaba.nacos.naming.core.v2.client.Client;
|
import com.alibaba.nacos.naming.core.v2.client.Client;
|
||||||
import com.alibaba.nacos.naming.core.v2.client.ClientAttributes;
|
import com.alibaba.nacos.naming.core.v2.client.ClientAttributes;
|
||||||
@ -47,7 +47,6 @@ import com.alibaba.nacos.naming.core.v2.pojo.InstancePublishInfo;
|
|||||||
import com.alibaba.nacos.naming.core.v2.pojo.Service;
|
import com.alibaba.nacos.naming.core.v2.pojo.Service;
|
||||||
import com.alibaba.nacos.naming.core.v2.service.ClientOperationService;
|
import com.alibaba.nacos.naming.core.v2.service.ClientOperationService;
|
||||||
import com.alibaba.nacos.naming.pojo.Subscriber;
|
import com.alibaba.nacos.naming.pojo.Subscriber;
|
||||||
import com.alibaba.nacos.naming.constants.Constants;
|
|
||||||
import com.alibaba.nacos.sys.utils.ApplicationUtils;
|
import com.alibaba.nacos.sys.utils.ApplicationUtils;
|
||||||
import com.alibaba.nacos.sys.utils.DiskUtils;
|
import com.alibaba.nacos.sys.utils.DiskUtils;
|
||||||
import com.alipay.sofa.jraft.util.CRC64;
|
import com.alipay.sofa.jraft.util.CRC64;
|
||||||
@ -62,6 +61,7 @@ import java.nio.file.Paths;
|
|||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import java.util.concurrent.locks.Lock;
|
import java.util.concurrent.locks.Lock;
|
||||||
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
||||||
|
@ -18,7 +18,6 @@ package com.alibaba.nacos.sys.env;
|
|||||||
|
|
||||||
import com.alibaba.nacos.common.JustForTest;
|
import com.alibaba.nacos.common.JustForTest;
|
||||||
import com.alibaba.nacos.common.utils.IoUtils;
|
import com.alibaba.nacos.common.utils.IoUtils;
|
||||||
import com.alibaba.nacos.common.utils.Objects;
|
|
||||||
import com.alibaba.nacos.common.utils.StringUtils;
|
import com.alibaba.nacos.common.utils.StringUtils;
|
||||||
import com.alibaba.nacos.common.utils.ThreadUtils;
|
import com.alibaba.nacos.common.utils.ThreadUtils;
|
||||||
import com.alibaba.nacos.sys.utils.DiskUtils;
|
import com.alibaba.nacos.sys.utils.DiskUtils;
|
||||||
@ -42,6 +41,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Its own configuration information manipulation tool class.
|
* Its own configuration information manipulation tool class.
|
||||||
|
@ -17,7 +17,6 @@
|
|||||||
package com.alibaba.nacos.sys.utils;
|
package com.alibaba.nacos.sys.utils;
|
||||||
|
|
||||||
import com.alibaba.nacos.common.utils.ByteUtils;
|
import com.alibaba.nacos.common.utils.ByteUtils;
|
||||||
import com.alibaba.nacos.common.utils.Objects;
|
|
||||||
import org.apache.commons.io.FileUtils;
|
import org.apache.commons.io.FileUtils;
|
||||||
import org.apache.commons.io.IOUtils;
|
import org.apache.commons.io.IOUtils;
|
||||||
import org.apache.commons.io.output.NullOutputStream;
|
import org.apache.commons.io.output.NullOutputStream;
|
||||||
@ -43,6 +42,7 @@ import java.nio.charset.StandardCharsets;
|
|||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
import java.util.zip.CheckedInputStream;
|
import java.util.zip.CheckedInputStream;
|
||||||
import java.util.zip.CheckedOutputStream;
|
import java.util.zip.CheckedOutputStream;
|
||||||
|
Loading…
Reference in New Issue
Block a user