From 3eff33276492d3ef5c9e29f0cf1e0dd8895aa05d Mon Sep 17 00:00:00 2001 From: Jonathan Shook Date: Tue, 8 Mar 2022 14:17:33 -0600 Subject: [PATCH] add aplv2 headers to virtdata-lib-random --- .../virtdata/library/random/Murmur3Time.java | 18 +++++++++++- .../random/RandomFileExtractToString.java | 25 ++++++++--------- .../library/random/RandomLineToInt.java | 16 +++++++++++ .../library/random/RandomLineToString.java | 22 +++++++-------- .../library/random/RandomLineToStringMap.java | 22 +++++++-------- .../random/RandomLinesToKeyValueString.java | 22 +++++++-------- .../library/random/RandomLongToString.java | 22 +++++++-------- .../random/RandomLoremExtractToString.java | 22 +++++++-------- .../library/random/RandomRangedToDouble.java | 16 +++++++++++ .../library/random/RandomRangedToInt.java | 22 +++++++-------- .../library/random/RandomRangedToLong.java | 22 +++++++-------- .../library/random/RandomRangedToString.java | 28 +++++++++---------- .../library/random/RandomToByteBuffer.java | 24 ++++++++-------- 13 files changed, 155 insertions(+), 126 deletions(-) diff --git a/virtdata-lib-random/src/main/java/io/nosqlbench/virtdata/library/random/Murmur3Time.java b/virtdata-lib-random/src/main/java/io/nosqlbench/virtdata/library/random/Murmur3Time.java index 3f11340ae..39497cde4 100644 --- a/virtdata-lib-random/src/main/java/io/nosqlbench/virtdata/library/random/Murmur3Time.java +++ b/virtdata-lib-random/src/main/java/io/nosqlbench/virtdata/library/random/Murmur3Time.java @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2022 nosqlbench + * + * 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 io.nosqlbench.virtdata.library.random; @@ -10,7 +26,7 @@ import java.util.function.LongUnaryOperator; * This is used as a control for the concurrent generation tester. */ public class Murmur3Time implements LongUnaryOperator { - private Murmur3F murmur3F = new Murmur3F(Thread.currentThread().getName().hashCode()); + private final Murmur3F murmur3F = new Murmur3F(Thread.currentThread().getName().hashCode()); @Override public long applyAsLong(long operand) { murmur3F.updateLongLE(System.nanoTime()); diff --git a/virtdata-lib-random/src/main/java/io/nosqlbench/virtdata/library/random/RandomFileExtractToString.java b/virtdata-lib-random/src/main/java/io/nosqlbench/virtdata/library/random/RandomFileExtractToString.java index 056e22174..c97cfbbc8 100644 --- a/virtdata-lib-random/src/main/java/io/nosqlbench/virtdata/library/random/RandomFileExtractToString.java +++ b/virtdata-lib-random/src/main/java/io/nosqlbench/virtdata/library/random/RandomFileExtractToString.java @@ -1,19 +1,17 @@ /* + * Copyright (c) 2022 nosqlbench * - * Copyright 2015 Jonathan Shook + * 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 * - * 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. + * 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 io.nosqlbench.virtdata.library.random; @@ -36,7 +34,8 @@ public class RandomFileExtractToString implements LongFunction { private static CharBuffer fileDataImage =null; - private int minsize, maxsize; + private final int minsize; + private final int maxsize; private final MersenneTwister rng; private final IntegerDistribution sizeDistribution; private final IntegerDistribution positionDistribution; diff --git a/virtdata-lib-random/src/main/java/io/nosqlbench/virtdata/library/random/RandomLineToInt.java b/virtdata-lib-random/src/main/java/io/nosqlbench/virtdata/library/random/RandomLineToInt.java index 07b9351e3..b97a1bbde 100644 --- a/virtdata-lib-random/src/main/java/io/nosqlbench/virtdata/library/random/RandomLineToInt.java +++ b/virtdata-lib-random/src/main/java/io/nosqlbench/virtdata/library/random/RandomLineToInt.java @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2022 nosqlbench + * + * 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 io.nosqlbench.virtdata.library.random; import io.nosqlbench.nb.api.content.NBIO; diff --git a/virtdata-lib-random/src/main/java/io/nosqlbench/virtdata/library/random/RandomLineToString.java b/virtdata-lib-random/src/main/java/io/nosqlbench/virtdata/library/random/RandomLineToString.java index c25ab997c..f0897bc58 100644 --- a/virtdata-lib-random/src/main/java/io/nosqlbench/virtdata/library/random/RandomLineToString.java +++ b/virtdata-lib-random/src/main/java/io/nosqlbench/virtdata/library/random/RandomLineToString.java @@ -1,19 +1,17 @@ /* + * Copyright (c) 2022 nosqlbench * - * Copyright 2015 Jonathan Shook + * 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 * - * 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. + * 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 io.nosqlbench.virtdata.library.random; diff --git a/virtdata-lib-random/src/main/java/io/nosqlbench/virtdata/library/random/RandomLineToStringMap.java b/virtdata-lib-random/src/main/java/io/nosqlbench/virtdata/library/random/RandomLineToStringMap.java index a62d263e3..e816cc8a8 100644 --- a/virtdata-lib-random/src/main/java/io/nosqlbench/virtdata/library/random/RandomLineToStringMap.java +++ b/virtdata-lib-random/src/main/java/io/nosqlbench/virtdata/library/random/RandomLineToStringMap.java @@ -1,19 +1,17 @@ /* + * Copyright (c) 2022 nosqlbench * - * Copyright 2015 Jonathan Shook + * 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 * - * 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. + * 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 io.nosqlbench.virtdata.library.random; diff --git a/virtdata-lib-random/src/main/java/io/nosqlbench/virtdata/library/random/RandomLinesToKeyValueString.java b/virtdata-lib-random/src/main/java/io/nosqlbench/virtdata/library/random/RandomLinesToKeyValueString.java index 7fd3d83b8..902619461 100644 --- a/virtdata-lib-random/src/main/java/io/nosqlbench/virtdata/library/random/RandomLinesToKeyValueString.java +++ b/virtdata-lib-random/src/main/java/io/nosqlbench/virtdata/library/random/RandomLinesToKeyValueString.java @@ -1,19 +1,17 @@ /* + * Copyright (c) 2022 nosqlbench * - * Copyright 2015 Jonathan Shook + * 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 * - * 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. + * 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 io.nosqlbench.virtdata.library.random; diff --git a/virtdata-lib-random/src/main/java/io/nosqlbench/virtdata/library/random/RandomLongToString.java b/virtdata-lib-random/src/main/java/io/nosqlbench/virtdata/library/random/RandomLongToString.java index d7be06af2..ae2fd121c 100644 --- a/virtdata-lib-random/src/main/java/io/nosqlbench/virtdata/library/random/RandomLongToString.java +++ b/virtdata-lib-random/src/main/java/io/nosqlbench/virtdata/library/random/RandomLongToString.java @@ -1,19 +1,17 @@ /* + * Copyright (c) 2022 nosqlbench * - * Copyright 2015 Jonathan Shook + * 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 * - * 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. + * 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 io.nosqlbench.virtdata.library.random; diff --git a/virtdata-lib-random/src/main/java/io/nosqlbench/virtdata/library/random/RandomLoremExtractToString.java b/virtdata-lib-random/src/main/java/io/nosqlbench/virtdata/library/random/RandomLoremExtractToString.java index 31a34acf6..2ffaf4bf3 100644 --- a/virtdata-lib-random/src/main/java/io/nosqlbench/virtdata/library/random/RandomLoremExtractToString.java +++ b/virtdata-lib-random/src/main/java/io/nosqlbench/virtdata/library/random/RandomLoremExtractToString.java @@ -1,19 +1,17 @@ /* + * Copyright (c) 2022 nosqlbench * - * Copyright 2015 Jonathan Shook + * 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 * - * 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.pache.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. + * 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 io.nosqlbench.virtdata.library.random; diff --git a/virtdata-lib-random/src/main/java/io/nosqlbench/virtdata/library/random/RandomRangedToDouble.java b/virtdata-lib-random/src/main/java/io/nosqlbench/virtdata/library/random/RandomRangedToDouble.java index cd257a5e4..4f9fe57aa 100644 --- a/virtdata-lib-random/src/main/java/io/nosqlbench/virtdata/library/random/RandomRangedToDouble.java +++ b/virtdata-lib-random/src/main/java/io/nosqlbench/virtdata/library/random/RandomRangedToDouble.java @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2022 nosqlbench + * + * 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 io.nosqlbench.virtdata.library.random; import io.nosqlbench.virtdata.api.annotations.DeprecatedFunction; diff --git a/virtdata-lib-random/src/main/java/io/nosqlbench/virtdata/library/random/RandomRangedToInt.java b/virtdata-lib-random/src/main/java/io/nosqlbench/virtdata/library/random/RandomRangedToInt.java index 9c3027764..9297a5f6c 100644 --- a/virtdata-lib-random/src/main/java/io/nosqlbench/virtdata/library/random/RandomRangedToInt.java +++ b/virtdata-lib-random/src/main/java/io/nosqlbench/virtdata/library/random/RandomRangedToInt.java @@ -1,19 +1,17 @@ /* + * Copyright (c) 2022 nosqlbench * - * Copyright 2015 Jonathan Shook + * 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 * - * 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. + * 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 io.nosqlbench.virtdata.library.random; diff --git a/virtdata-lib-random/src/main/java/io/nosqlbench/virtdata/library/random/RandomRangedToLong.java b/virtdata-lib-random/src/main/java/io/nosqlbench/virtdata/library/random/RandomRangedToLong.java index e0b8f7346..bb65a7e7a 100644 --- a/virtdata-lib-random/src/main/java/io/nosqlbench/virtdata/library/random/RandomRangedToLong.java +++ b/virtdata-lib-random/src/main/java/io/nosqlbench/virtdata/library/random/RandomRangedToLong.java @@ -1,19 +1,17 @@ /* + * Copyright (c) 2022 nosqlbench * - * Copyright 2015 Jonathan Shook + * 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 * - * 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. + * 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 io.nosqlbench.virtdata.library.random; diff --git a/virtdata-lib-random/src/main/java/io/nosqlbench/virtdata/library/random/RandomRangedToString.java b/virtdata-lib-random/src/main/java/io/nosqlbench/virtdata/library/random/RandomRangedToString.java index 63ac952ae..3d0ef1e40 100644 --- a/virtdata-lib-random/src/main/java/io/nosqlbench/virtdata/library/random/RandomRangedToString.java +++ b/virtdata-lib-random/src/main/java/io/nosqlbench/virtdata/library/random/RandomRangedToString.java @@ -1,19 +1,17 @@ /* + * Copyright (c) 2022 nosqlbench * - * Copyright 2015 Jonathan Shook + * 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 * - * 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. + * 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 io.nosqlbench.virtdata.library.random; @@ -26,9 +24,9 @@ import java.util.function.LongFunction; @DeprecatedFunction("random mappers are not deterministic. They will be replaced with hash-based functions.") public class RandomRangedToString implements LongFunction { private final MersenneTwister theTwister; - private long min; - private long max; - private long _length; + private final long min; + private final long max; + private final long _length; public RandomRangedToString(long min, long max) { this(min,max,System.nanoTime()); diff --git a/virtdata-lib-random/src/main/java/io/nosqlbench/virtdata/library/random/RandomToByteBuffer.java b/virtdata-lib-random/src/main/java/io/nosqlbench/virtdata/library/random/RandomToByteBuffer.java index a7e0f28c4..e5dfb6b00 100644 --- a/virtdata-lib-random/src/main/java/io/nosqlbench/virtdata/library/random/RandomToByteBuffer.java +++ b/virtdata-lib-random/src/main/java/io/nosqlbench/virtdata/library/random/RandomToByteBuffer.java @@ -1,19 +1,17 @@ /* + * Copyright (c) 2022 nosqlbench * - * Copyright 2015 Jonathan Shook + * 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 * - * 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. + * 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 io.nosqlbench.virtdata.library.random; @@ -28,7 +26,7 @@ import java.util.function.LongFunction; public class RandomToByteBuffer implements LongFunction { private final MersenneTwister rng; - private int length; + private final int length; public RandomToByteBuffer(int length) { this.length = length;