mirror of
https://github.com/microsoft/HybridRow.git
synced 2026-01-20 09:53:13 +00:00
Progressed on port from C# to Java
This commit is contained in:
480
dotnet/src/Core/UtfAnyString.cs
Normal file
480
dotnet/src/Core/UtfAnyString.cs
Normal file
@@ -0,0 +1,480 @@
|
||||
// ------------------------------------------------------------
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// ------------------------------------------------------------
|
||||
|
||||
#pragma warning disable CA2225 // Operator overloads have named alternates
|
||||
|
||||
// ReSharper disable once UseNameofExpression
|
||||
namespace Microsoft.Azure.Cosmos.Core.Utf8
|
||||
{
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
/// <summary>A string whose memory representation may be either UTF8 or UTF16.</summary>
|
||||
/// <remarks>
|
||||
/// This type supports polymorphic use of <see cref="string" /> and <see cref="Utf8String" />
|
||||
/// when equality, hashing, and comparison are needed against either encoding. An API leveraging
|
||||
/// <see cref="UtfAnyString" /> can avoid separate method overloads while still accepting either
|
||||
/// encoding without imposing additional allocations.
|
||||
/// </remarks>
|
||||
[DebuggerDisplay("{ToString()}")]
|
||||
public readonly struct UtfAnyString :
|
||||
IEquatable<UtfAnyString>, IComparable<UtfAnyString>,
|
||||
IEquatable<Utf8String>, IComparable<Utf8String>,
|
||||
IEquatable<string>, IComparable<string>
|
||||
{
|
||||
public static UtfAnyString Empty => string.Empty;
|
||||
|
||||
private readonly object buffer;
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public UtfAnyString(string utf16String)
|
||||
{
|
||||
this.buffer = utf16String;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public UtfAnyString(Utf8String utf8String)
|
||||
{
|
||||
this.buffer = utf8String;
|
||||
}
|
||||
|
||||
public bool IsUtf8 => this.buffer is Utf8String;
|
||||
|
||||
public bool IsUtf16 => this.buffer is string;
|
||||
|
||||
/// <summary>True if the length is empty.</summary>
|
||||
public bool IsNull => object.ReferenceEquals(null, this.buffer);
|
||||
|
||||
/// <summary>True if the length is empty.</summary>
|
||||
public bool IsEmpty
|
||||
{
|
||||
get
|
||||
{
|
||||
if (object.ReferenceEquals(null, this.buffer))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
switch (this.buffer)
|
||||
{
|
||||
case string s:
|
||||
return s.Length == 0;
|
||||
default:
|
||||
return ((Utf8String)this.buffer).IsEmpty;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static implicit operator UtfAnyString(string utf16String)
|
||||
{
|
||||
return new UtfAnyString(utf16String);
|
||||
}
|
||||
|
||||
public static implicit operator string(UtfAnyString str)
|
||||
{
|
||||
return str.buffer?.ToString();
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
// ReSharper disable once AssignNullToNotNullAttribute
|
||||
return this.buffer?.ToString();
|
||||
}
|
||||
|
||||
public Utf8String ToUtf8String()
|
||||
{
|
||||
if (object.ReferenceEquals(null, this.buffer))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
switch (this.buffer)
|
||||
{
|
||||
case string s:
|
||||
return Utf8String.TranscodeUtf16(s);
|
||||
default:
|
||||
return (Utf8String)this.buffer;
|
||||
}
|
||||
}
|
||||
|
||||
public bool ReferenceEquals(UtfAnyString other)
|
||||
{
|
||||
return this.buffer == other.buffer;
|
||||
}
|
||||
|
||||
public bool Equals(UtfAnyString other)
|
||||
{
|
||||
if (object.ReferenceEquals(null, this.buffer))
|
||||
{
|
||||
return object.ReferenceEquals(null, other.buffer);
|
||||
}
|
||||
|
||||
switch (this.buffer)
|
||||
{
|
||||
case string s:
|
||||
return other.Equals(s);
|
||||
default:
|
||||
return other.Equals((Utf8String)this.buffer);
|
||||
}
|
||||
}
|
||||
|
||||
public bool Equals(Utf8Span other)
|
||||
{
|
||||
return other.Equals(this.buffer);
|
||||
}
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
switch (obj)
|
||||
{
|
||||
case string s:
|
||||
return this.Equals(s);
|
||||
case Utf8String s:
|
||||
return this.Equals(s);
|
||||
case UtfAnyString s:
|
||||
return this.Equals(s);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool Equals(Utf8String other)
|
||||
{
|
||||
if (object.ReferenceEquals(null, other))
|
||||
{
|
||||
return object.ReferenceEquals(null, this.buffer);
|
||||
}
|
||||
|
||||
return other.Equals(this.buffer);
|
||||
}
|
||||
|
||||
public bool Equals(string other)
|
||||
{
|
||||
if (object.ReferenceEquals(null, this.buffer))
|
||||
{
|
||||
return object.ReferenceEquals(null, other);
|
||||
}
|
||||
|
||||
switch (this.buffer)
|
||||
{
|
||||
case string s:
|
||||
return string.Equals(s, other, StringComparison.Ordinal);
|
||||
default:
|
||||
return ((Utf8String)this.buffer).Equals(other);
|
||||
}
|
||||
}
|
||||
|
||||
public static bool operator ==(UtfAnyString left, UtfAnyString right)
|
||||
{
|
||||
return left.Equals(right);
|
||||
}
|
||||
|
||||
public static bool operator !=(UtfAnyString left, UtfAnyString right)
|
||||
{
|
||||
return !left.Equals(right);
|
||||
}
|
||||
|
||||
public static bool operator ==(UtfAnyString left, string right)
|
||||
{
|
||||
return left.Equals(right);
|
||||
}
|
||||
|
||||
public static bool operator !=(UtfAnyString left, string right)
|
||||
{
|
||||
return !left.Equals(right);
|
||||
}
|
||||
|
||||
public static bool operator ==(string left, UtfAnyString right)
|
||||
{
|
||||
return right.Equals(left);
|
||||
}
|
||||
|
||||
public static bool operator !=(string left, UtfAnyString right)
|
||||
{
|
||||
return !right.Equals(left);
|
||||
}
|
||||
|
||||
public static bool operator ==(UtfAnyString left, Utf8String right)
|
||||
{
|
||||
return left.Equals(right);
|
||||
}
|
||||
|
||||
public static bool operator !=(UtfAnyString left, Utf8String right)
|
||||
{
|
||||
return !left.Equals(right);
|
||||
}
|
||||
|
||||
public static bool operator ==(Utf8String left, UtfAnyString right)
|
||||
{
|
||||
return right.Equals(left);
|
||||
}
|
||||
|
||||
public static bool operator !=(Utf8String left, UtfAnyString right)
|
||||
{
|
||||
return !right.Equals(left);
|
||||
}
|
||||
|
||||
public static bool operator ==(UtfAnyString left, Utf8Span right)
|
||||
{
|
||||
return left.Equals(right);
|
||||
}
|
||||
|
||||
public static bool operator !=(UtfAnyString left, Utf8Span right)
|
||||
{
|
||||
return !left.Equals(right);
|
||||
}
|
||||
|
||||
public static bool operator ==(Utf8Span left, UtfAnyString right)
|
||||
{
|
||||
return right.Equals(left);
|
||||
}
|
||||
|
||||
public static bool operator !=(Utf8Span left, UtfAnyString right)
|
||||
{
|
||||
return !right.Equals(left);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
uint hash1 = 5381;
|
||||
uint hash2 = hash1;
|
||||
|
||||
if (object.ReferenceEquals(null, this.buffer))
|
||||
{
|
||||
return unchecked((int)(hash1 + (hash2 * 1566083941)));
|
||||
}
|
||||
|
||||
switch (this.buffer)
|
||||
{
|
||||
case string s:
|
||||
unchecked
|
||||
{
|
||||
Utf16LittleEndianCodePointEnumerator thisEnumerator = new Utf16LittleEndianCodePointEnumerator(s);
|
||||
for (int i = 0; thisEnumerator.MoveNext(); i++)
|
||||
{
|
||||
uint c = thisEnumerator.Current;
|
||||
if (i % 2 == 0)
|
||||
{
|
||||
hash1 = ((hash1 << 5) + hash1) ^ c;
|
||||
}
|
||||
else
|
||||
{
|
||||
hash2 = ((hash2 << 5) + hash2) ^ c;
|
||||
}
|
||||
}
|
||||
|
||||
return (int)(hash1 + (hash2 * 1566083941));
|
||||
}
|
||||
|
||||
default:
|
||||
return this.buffer.GetHashCode();
|
||||
}
|
||||
}
|
||||
|
||||
public static bool operator <(UtfAnyString left, UtfAnyString right)
|
||||
{
|
||||
return left.CompareTo(right) < 0;
|
||||
}
|
||||
|
||||
public static bool operator <=(UtfAnyString left, UtfAnyString right)
|
||||
{
|
||||
return left.CompareTo(right) <= 0;
|
||||
}
|
||||
|
||||
public static bool operator >(UtfAnyString left, UtfAnyString right)
|
||||
{
|
||||
return left.CompareTo(right) > 0;
|
||||
}
|
||||
|
||||
public static bool operator >=(UtfAnyString left, UtfAnyString right)
|
||||
{
|
||||
return left.CompareTo(right) >= 0;
|
||||
}
|
||||
|
||||
public static bool operator <(UtfAnyString left, string right)
|
||||
{
|
||||
return left.CompareTo(right) < 0;
|
||||
}
|
||||
|
||||
public static bool operator <=(UtfAnyString left, string right)
|
||||
{
|
||||
return left.CompareTo(right) <= 0;
|
||||
}
|
||||
|
||||
public static bool operator >(UtfAnyString left, string right)
|
||||
{
|
||||
return left.CompareTo(right) > 0;
|
||||
}
|
||||
|
||||
public static bool operator >=(UtfAnyString left, string right)
|
||||
{
|
||||
return left.CompareTo(right) >= 0;
|
||||
}
|
||||
|
||||
public static bool operator <(string left, UtfAnyString right)
|
||||
{
|
||||
return right.CompareTo(left) >= 0;
|
||||
}
|
||||
|
||||
public static bool operator <=(string left, UtfAnyString right)
|
||||
{
|
||||
return right.CompareTo(left) > 0;
|
||||
}
|
||||
|
||||
public static bool operator >(string left, UtfAnyString right)
|
||||
{
|
||||
return right.CompareTo(left) <= 0;
|
||||
}
|
||||
|
||||
public static bool operator >=(string left, UtfAnyString right)
|
||||
{
|
||||
return right.CompareTo(left) < 0;
|
||||
}
|
||||
|
||||
public static bool operator <(UtfAnyString left, Utf8String right)
|
||||
{
|
||||
return left.CompareTo(right) < 0;
|
||||
}
|
||||
|
||||
public static bool operator <=(UtfAnyString left, Utf8String right)
|
||||
{
|
||||
return left.CompareTo(right) <= 0;
|
||||
}
|
||||
|
||||
public static bool operator >(UtfAnyString left, Utf8String right)
|
||||
{
|
||||
return left.CompareTo(right) > 0;
|
||||
}
|
||||
|
||||
public static bool operator >=(UtfAnyString left, Utf8String right)
|
||||
{
|
||||
return left.CompareTo(right) >= 0;
|
||||
}
|
||||
|
||||
public static bool operator <(Utf8String left, UtfAnyString right)
|
||||
{
|
||||
return right.CompareTo(left) >= 0;
|
||||
}
|
||||
|
||||
public static bool operator <=(Utf8String left, UtfAnyString right)
|
||||
{
|
||||
return right.CompareTo(left) > 0;
|
||||
}
|
||||
|
||||
public static bool operator >(Utf8String left, UtfAnyString right)
|
||||
{
|
||||
return right.CompareTo(left) <= 0;
|
||||
}
|
||||
|
||||
public static bool operator >=(Utf8String left, UtfAnyString right)
|
||||
{
|
||||
return right.CompareTo(left) < 0;
|
||||
}
|
||||
|
||||
public static bool operator <(UtfAnyString left, Utf8Span right)
|
||||
{
|
||||
return left.CompareTo(right) < 0;
|
||||
}
|
||||
|
||||
public static bool operator <=(UtfAnyString left, Utf8Span right)
|
||||
{
|
||||
return left.CompareTo(right) <= 0;
|
||||
}
|
||||
|
||||
public static bool operator >(UtfAnyString left, Utf8Span right)
|
||||
{
|
||||
return left.CompareTo(right) > 0;
|
||||
}
|
||||
|
||||
public static bool operator >=(UtfAnyString left, Utf8Span right)
|
||||
{
|
||||
return left.CompareTo(right) >= 0;
|
||||
}
|
||||
|
||||
public static bool operator <(Utf8Span left, UtfAnyString right)
|
||||
{
|
||||
return right.CompareTo(left) >= 0;
|
||||
}
|
||||
|
||||
public static bool operator <=(Utf8Span left, UtfAnyString right)
|
||||
{
|
||||
return right.CompareTo(left) > 0;
|
||||
}
|
||||
|
||||
public static bool operator >(Utf8Span left, UtfAnyString right)
|
||||
{
|
||||
return right.CompareTo(left) <= 0;
|
||||
}
|
||||
|
||||
public static bool operator >=(Utf8Span left, UtfAnyString right)
|
||||
{
|
||||
return right.CompareTo(left) < 0;
|
||||
}
|
||||
|
||||
public int CompareTo(UtfAnyString other)
|
||||
{
|
||||
if (object.ReferenceEquals(null, other.buffer))
|
||||
{
|
||||
return object.ReferenceEquals(null, this.buffer) ? 0 : 1;
|
||||
}
|
||||
|
||||
switch (other.buffer)
|
||||
{
|
||||
case string s:
|
||||
return this.CompareTo(s);
|
||||
default:
|
||||
return this.CompareTo((Utf8String)other.buffer);
|
||||
}
|
||||
}
|
||||
|
||||
public int CompareTo(Utf8String other)
|
||||
{
|
||||
if (object.ReferenceEquals(null, this.buffer))
|
||||
{
|
||||
return object.ReferenceEquals(null, other) ? 0 : -1;
|
||||
}
|
||||
|
||||
switch (this.buffer)
|
||||
{
|
||||
case string s:
|
||||
return -other.Span.CompareTo(s);
|
||||
default:
|
||||
return -other.Span.CompareTo((Utf8String)this.buffer);
|
||||
}
|
||||
}
|
||||
|
||||
public int CompareTo(Utf8Span other)
|
||||
{
|
||||
if (object.ReferenceEquals(null, this.buffer))
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
switch (this.buffer)
|
||||
{
|
||||
case string s:
|
||||
return -other.CompareTo(s);
|
||||
default:
|
||||
return -other.CompareTo((Utf8String)this.buffer);
|
||||
}
|
||||
}
|
||||
|
||||
public int CompareTo(string other)
|
||||
{
|
||||
if (object.ReferenceEquals(null, this.buffer))
|
||||
{
|
||||
return object.ReferenceEquals(null, other) ? 0 : -1;
|
||||
}
|
||||
|
||||
switch (this.buffer)
|
||||
{
|
||||
case string s:
|
||||
return string.Compare(s, other, StringComparison.Ordinal);
|
||||
default:
|
||||
return ((Utf8String)this.buffer).CompareTo(other);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -36,7 +36,7 @@ Licensed under the MIT License.
|
||||
<site.url/>
|
||||
<test.groups>unit</test.groups>
|
||||
<javadoc.opts/>
|
||||
<guava.version>27.0.1-jre</guava.version>
|
||||
<guava.version>28.0-jre</guava.version>
|
||||
<jackson.version>2.9.9</jackson.version>
|
||||
<mockito.version>1.10.19</mockito.version>
|
||||
<mongodb.version>3.11.0</mongodb.version>
|
||||
|
||||
81
jre/src/main/java/com/azure/data/cosmos/core/Out.java
Normal file
81
jre/src/main/java/com/azure/data/cosmos/core/Out.java
Normal file
@@ -0,0 +1,81 @@
|
||||
//------------------------------------------------------------
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//------------------------------------------------------------
|
||||
|
||||
package com.azure.data.cosmos.core;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* A container object which may or may not contain a non-null value
|
||||
*
|
||||
* This is a value-based class and as such use of identity-sensitive operations--including reference equality
|
||||
* ({@code ==}), identity hash code, or synchronization--on instances of {@Out} may have unpredictable results and
|
||||
* should be avoided.
|
||||
*
|
||||
* @param <T>
|
||||
*/
|
||||
public final class Out<T> {
|
||||
|
||||
private volatile T value;
|
||||
|
||||
public T get() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void set(T value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@code true} if there is a value present, otherwise {@code false}
|
||||
* <p>
|
||||
* This is equivalent to evaluating the expression {@code out.get() == null}.
|
||||
*
|
||||
* @return {@code true} if there is a value present, otherwise {@code false}
|
||||
*/
|
||||
public boolean isPresent() {
|
||||
return value != null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates whether some other object is equal to this {@link Out} value. The other object is considered equal if:
|
||||
* <ul>
|
||||
* <li>it is also an {@link Out} and;
|
||||
* <li>both instances have no value present or;
|
||||
* <li>the present values are equal to each other as determined by {@link T#equals(Object)}}.
|
||||
* </ul>
|
||||
*
|
||||
* @param other an object to be tested for equality
|
||||
* @return {code true} if the other object is equal to this object; otherwise {@code false}
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!(other instanceof Out)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return Objects.equals(value, ((Out)other).value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the hash code value of the present value, if any, or 0 (zero) if
|
||||
* no value is present.
|
||||
*
|
||||
* @return hash code value of the present value or 0 if no value is present
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hashCode(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return value == null ? "null" : value.toString();
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
//------------------------------------------------------------
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//------------------------------------------------------------
|
||||
|
||||
package com.azure.data.cosmos.core;
|
||||
|
||||
public final class OutObject<T> {
|
||||
|
||||
private T value;
|
||||
|
||||
public T get() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void set(T value) {
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
//------------------------------------------------------------
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//------------------------------------------------------------
|
||||
|
||||
package com.azure.data.cosmos.core;
|
||||
|
||||
public final class RefObject<T> {
|
||||
|
||||
private T value;
|
||||
|
||||
public RefObject(T value) {
|
||||
this.set(value);
|
||||
}
|
||||
|
||||
public T get() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void set(T value) {
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
75
jre/src/main/java/com/azure/data/cosmos/core/Reference.java
Normal file
75
jre/src/main/java/com/azure/data/cosmos/core/Reference.java
Normal file
@@ -0,0 +1,75 @@
|
||||
//------------------------------------------------------------
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//------------------------------------------------------------
|
||||
|
||||
package com.azure.data.cosmos.core;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* A container object which may or may not contain a non-null value
|
||||
*
|
||||
* This is a value-based class and as such use of identity-sensitive operations--including reference equality
|
||||
* ({@code ==}), identity hash code, or synchronization--on instances of {@Ref} may have unpredictable results and
|
||||
* should be avoided.
|
||||
*
|
||||
* @param <T>
|
||||
*/
|
||||
public final class Reference<T> {
|
||||
|
||||
private volatile T value;
|
||||
|
||||
public Reference(T value) {
|
||||
this.set(value);
|
||||
}
|
||||
|
||||
public T get() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void set(T value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@code true} if there is a value present, otherwise {@code false}
|
||||
*
|
||||
* This is equivalent to evaluating the expression {@code ref.get() == null}.
|
||||
*
|
||||
* @return {@code true} if there is a value present, otherwise {@code false}
|
||||
*/
|
||||
public boolean isPresent() {
|
||||
return value != null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates whether some other object is equal to this {@link Reference} value. The other object is considered equal if:
|
||||
* <ul>
|
||||
* <li>it is also an {@link Reference} and;
|
||||
* <li>both instances have no value present or;
|
||||
* <li>the present values are equal to each other as determined by {@link T#equals(Object)}}.
|
||||
* </ul>
|
||||
*
|
||||
* @param other an object to be tested for equality
|
||||
* @return {code true} if the other object is equal to this object; otherwise {@code false}
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!(other instanceof Reference)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return Objects.equals(value, ((Reference)other).value);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return value == null ? "null" : value.toString();
|
||||
}
|
||||
}
|
||||
@@ -251,10 +251,10 @@ public final class Utf8String implements CharSequence, Comparable<Utf8String> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a <see cref="Utf8String" /> from a UTF16 encoding string.
|
||||
* Creates a {@link Utf8String} from a UTF16 encoding string.
|
||||
*
|
||||
* @param string The UTF16 encoding string.
|
||||
* @return A new <see cref="Utf8String" />.
|
||||
* @return A new {@link Utf8String}.
|
||||
* <p>
|
||||
* This method must transcode the UTF-16 into UTF-8 which both requires allocation and is a size of data operation.
|
||||
*/
|
||||
|
||||
@@ -36,7 +36,7 @@ package com.azure.data.cosmos.serialization.hybridrow;
|
||||
//C# TO JAVA CONVERTER WARNING: Java has no equivalent to the C# readonly struct:
|
||||
public final class Float128 {
|
||||
/**
|
||||
* The size (in bytes) of a <see cref="Float128" />.
|
||||
* The size (in bytes) of a {@link Float128}.
|
||||
*/
|
||||
public static final int Size = (Long.SIZE / Byte.SIZE) + (Long.SIZE / Byte.SIZE);
|
||||
/**
|
||||
@@ -51,7 +51,7 @@ public final class Float128 {
|
||||
public long Low;
|
||||
|
||||
/**
|
||||
* Initializes a new instance of the <see cref="Float128" /> struct.
|
||||
* Initializes a new instance of the {@link Float128} struct.
|
||||
*
|
||||
* @param high the high-order 64 bits.
|
||||
* @param low the low-order 64 bits.
|
||||
|
||||
@@ -28,7 +28,7 @@ public final class HybridRowHeader {
|
||||
private HybridRowVersion Version = HybridRowVersion.values()[0];
|
||||
|
||||
/**
|
||||
* Initializes a new instance of the <see cref="HybridRowHeader"/> struct.
|
||||
* Initializes a new instance of the {@link HybridRowHeader} struct.
|
||||
*
|
||||
* @param version The version of the HybridRow library used to write this row.
|
||||
* @param schemaId The unique identifier of the schema whose layout was used to write this row.
|
||||
|
||||
@@ -17,12 +17,12 @@ package com.azure.data.cosmos.serialization.hybridrow;
|
||||
public final class NullValue implements IEquatable<NullValue> {
|
||||
/**
|
||||
* The default null literal.
|
||||
* This is the same value as default(<see cref="NullValue" />).
|
||||
* This is the same value as default({@link NullValue}).
|
||||
*/
|
||||
public static final NullValue Default = new NullValue();
|
||||
|
||||
/**
|
||||
* Returns true if this is the same value as <see cref="other" />.
|
||||
* Returns true if this is the same value as {@link other}.
|
||||
*
|
||||
* @param other The value to compare against.
|
||||
* @return True if the two values are the same.
|
||||
@@ -32,7 +32,7 @@ public final class NullValue implements IEquatable<NullValue> {
|
||||
}
|
||||
|
||||
/**
|
||||
* <see cref="object.Equals(object)" /> overload.
|
||||
* {@link object.Equals(object)} overload.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
@@ -44,7 +44,7 @@ public final class NullValue implements IEquatable<NullValue> {
|
||||
}
|
||||
|
||||
/**
|
||||
* <see cref="object.GetHashCode" /> overload.
|
||||
* {@link object.GetHashCode} overload.
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -9,7 +9,8 @@ package com.azure.data.cosmos.serialization.hybridrow;
|
||||
|
||||
// ReSharper disable InconsistentNaming
|
||||
|
||||
import com.azure.data.cosmos.core.RefObject;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.layouts.Layout;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutEndScope;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutScope;
|
||||
@@ -30,7 +31,7 @@ public final class RowCursor {
|
||||
*/
|
||||
public LayoutType cellType;
|
||||
/**
|
||||
* For types with generic parameters (e.g. <see cref="LayoutTuple" />, the type parameters.
|
||||
* For types with generic parameters (e.g. {@link LayoutTuple}, the type parameters.
|
||||
*/
|
||||
public TypeArgumentList cellTypeArgs = new TypeArgumentList();
|
||||
/**
|
||||
@@ -102,7 +103,7 @@ public final class RowCursor {
|
||||
*/
|
||||
public StringToken writePathToken = new StringToken();
|
||||
|
||||
public static RowCursor Create(RefObject<RowBuffer> row) {
|
||||
public static RowCursor Create(Reference<RowBuffer> row) {
|
||||
SchemaId schemaId = row.get().ReadSchemaId(1).clone();
|
||||
Layout layout = row.get().getResolver().Resolve(schemaId.clone());
|
||||
int sparseSegmentOffset = row.get().ComputeVariableValueOffset(layout, HybridRowHeader.Size,
|
||||
@@ -221,7 +222,7 @@ public final class RowCursor {
|
||||
LayoutType getScopeType()
|
||||
|
||||
/**
|
||||
* For types with generic parameters (e.g. <see cref="LayoutTuple" />, the type parameters.
|
||||
* For types with generic parameters (e.g. {@link LayoutTuple}, the type parameters.
|
||||
*/
|
||||
// TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes:
|
||||
//ORIGINAL LINE: [DebuggerBrowsable(DebuggerBrowsableState.Never)] public TypeArgumentList ScopeTypeArgs
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
|
||||
package com.azure.data.cosmos.serialization.hybridrow;
|
||||
|
||||
import com.azure.data.cosmos.core.RefObject;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutCode;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutEndScope;
|
||||
|
||||
@@ -14,7 +15,7 @@ public final class RowCursorExtensions {
|
||||
/** Makes a copy of the current cursor.
|
||||
|
||||
The two cursors will have independent and unconnected lifetimes after cloning. However,
|
||||
mutations to a <see cref="RowBuffer" /> can invalidate any active cursors over the same row.
|
||||
mutations to a {@link RowBuffer} can invalidate any active cursors over the same row.
|
||||
|
||||
*/
|
||||
// TODO: C# TO JAVA CONVERTER: 'ref return' methods are not converted by C# to Java Converter:
|
||||
@@ -78,14 +79,14 @@ public final class RowCursorExtensions {
|
||||
// edit.writePathToken = pathToken;
|
||||
// return ref edit;
|
||||
// }
|
||||
public static boolean MoveNext(RefObject<RowCursor> edit, RefObject<RowBuffer> row) {
|
||||
public static boolean MoveNext(Reference<RowCursor> edit, Reference<RowBuffer> row) {
|
||||
edit.get().writePath = null;
|
||||
edit.get().writePathToken = null;
|
||||
return row.get().SparseIteratorMoveNext(edit);
|
||||
}
|
||||
|
||||
public static boolean MoveNext(RefObject<RowCursor> edit, RefObject<RowBuffer> row,
|
||||
RefObject<RowCursor> childScope) {
|
||||
public static boolean MoveNext(Reference<RowCursor> edit, Reference<RowBuffer> row,
|
||||
Reference<RowCursor> childScope) {
|
||||
if (childScope.get().scopeType != null) {
|
||||
RowCursorExtensions.Skip(edit.get().clone(), row, childScope);
|
||||
}
|
||||
@@ -93,7 +94,7 @@ public final class RowCursorExtensions {
|
||||
return RowCursorExtensions.MoveNext(edit.get().clone(), row);
|
||||
}
|
||||
|
||||
public static boolean MoveTo(RefObject<RowCursor> edit, RefObject<RowBuffer> row, int index) {
|
||||
public static boolean MoveTo(Reference<RowCursor> edit, Reference<RowBuffer> row, int index) {
|
||||
checkState(edit.get().index <= index);
|
||||
edit.get().writePath = null;
|
||||
edit.get().writePathToken = null;
|
||||
@@ -106,8 +107,8 @@ public final class RowCursorExtensions {
|
||||
return true;
|
||||
}
|
||||
|
||||
public static void Skip(RefObject<RowCursor> edit, RefObject<RowBuffer> row,
|
||||
RefObject<RowCursor> childScope) {
|
||||
public static void Skip(Reference<RowCursor> edit, Reference<RowBuffer> row,
|
||||
Reference<RowCursor> childScope) {
|
||||
checkArgument(childScope.get().start == edit.get().valueOffset);
|
||||
if (!(childScope.get().cellType instanceof LayoutEndScope)) {
|
||||
while (row.get().SparseIteratorMoveNext(childScope)) {
|
||||
|
||||
@@ -31,8 +31,8 @@ public enum RowOptions {
|
||||
/**
|
||||
* Update an existing value or insert a new value, if no value exists.
|
||||
* <p>
|
||||
* If a value exists, then this operation becomes <see cref="Update" />, otherwise it
|
||||
* becomes <see cref="Insert" />.
|
||||
* If a value exists, then this operation becomes {@link Update}, otherwise it
|
||||
* becomes {@link Insert}.
|
||||
*/
|
||||
Upsert(3),
|
||||
|
||||
@@ -40,7 +40,7 @@ public enum RowOptions {
|
||||
* Insert a new value moving existing values to the right.
|
||||
* <p>
|
||||
* Within an array scope, inserts a new value immediately at the index moving all subsequent
|
||||
* items to the right. In any other scope behaves the same as <see cref="Upsert" />.
|
||||
* items to the right. In any other scope behaves the same as {@link Upsert}.
|
||||
*/
|
||||
InsertAt(4),
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ public final class SchemaId implements IEquatable<SchemaId> {
|
||||
private int Id;
|
||||
|
||||
/**
|
||||
* Initializes a new instance of the <see cref="SchemaId" /> struct.
|
||||
* Initializes a new instance of the {@link SchemaId} struct.
|
||||
*
|
||||
* @param id The underlying globally unique identifier of the schema.
|
||||
*/
|
||||
@@ -45,7 +45,7 @@ public final class SchemaId implements IEquatable<SchemaId> {
|
||||
}
|
||||
|
||||
/**
|
||||
* <see cref="object.Equals(object)" /> overload.
|
||||
* {@link object.Equals(object)} overload.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
@@ -57,7 +57,7 @@ public final class SchemaId implements IEquatable<SchemaId> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if this is the same <see cref="SchemaId" /> as <see cref="other" />.
|
||||
* Returns true if this is the same {@link SchemaId} as {@link other}.
|
||||
*
|
||||
* @param other The value to compare against.
|
||||
* @return True if the two values are the same.
|
||||
@@ -67,7 +67,7 @@ public final class SchemaId implements IEquatable<SchemaId> {
|
||||
}
|
||||
|
||||
/**
|
||||
* <see cref="object.GetHashCode" /> overload.
|
||||
* {@link object.GetHashCode} overload.
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
@@ -89,7 +89,7 @@ public final class SchemaId implements IEquatable<SchemaId> {
|
||||
}
|
||||
|
||||
/**
|
||||
* <see cref="object.ToString" /> overload.
|
||||
* {@link object.ToString} overload.
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
@@ -97,7 +97,7 @@ public final class SchemaId implements IEquatable<SchemaId> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper class for parsing <see cref="SchemaId" /> from JSON.
|
||||
* Helper class for parsing {@link SchemaId} from JSON.
|
||||
*/
|
||||
public static class SchemaIdConverter extends JsonConverter {
|
||||
@Override
|
||||
|
||||
@@ -7,7 +7,7 @@ package com.azure.data.cosmos.serialization.hybridrow;
|
||||
/**
|
||||
* A wall clock time expressed in milliseconds since the Unix Epoch.
|
||||
* <p>
|
||||
* A <see cref="UnixDateTime" /> is a fixed length value-type providing millisecond
|
||||
* A {@link UnixDateTime} is a fixed length value-type providing millisecond
|
||||
* granularity as a signed offset from the Unix Epoch (midnight, January 1, 1970 UTC).
|
||||
*/
|
||||
// TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes:
|
||||
@@ -21,9 +21,9 @@ package com.azure.data.cosmos.serialization.hybridrow;
|
||||
public final class UnixDateTime implements IEquatable<UnixDateTime> {
|
||||
/**
|
||||
* The unix epoch.
|
||||
* <see cref="UnixDateTime" /> values are signed values centered on <see cref="Epoch" />.
|
||||
* {@link UnixDateTime} values are signed values centered on {@link Epoch}.
|
||||
* <para />
|
||||
* This is the same value as default(<see cref="UnixDateTime" />).
|
||||
* This is the same value as default({@link UnixDateTime}).
|
||||
*/
|
||||
public static final UnixDateTime Epoch = new UnixDateTime();
|
||||
/**
|
||||
@@ -31,15 +31,15 @@ public final class UnixDateTime implements IEquatable<UnixDateTime> {
|
||||
*/
|
||||
public static final int Size = (Long.SIZE / Byte.SIZE);
|
||||
/**
|
||||
* The number of milliseconds since <see cref="Epoch" />.
|
||||
* The number of milliseconds since {@link Epoch}.
|
||||
* This value may be negative.
|
||||
*/
|
||||
private long Milliseconds;
|
||||
|
||||
/**
|
||||
* Initializes a new instance of the <see cref="UnixDateTime" /> struct.
|
||||
* Initializes a new instance of the {@link UnixDateTime} struct.
|
||||
*
|
||||
* @param milliseconds The number of milliseconds since <see cref="Epoch" />.
|
||||
* @param milliseconds The number of milliseconds since {@link Epoch}.
|
||||
*/
|
||||
public UnixDateTime() {
|
||||
}
|
||||
@@ -53,7 +53,7 @@ public final class UnixDateTime implements IEquatable<UnixDateTime> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if this is the same value as <see cref="other" />.
|
||||
* Returns true if this is the same value as {@link other}.
|
||||
*
|
||||
* @param other The value to compare against.
|
||||
* @return True if the two values are the same.
|
||||
@@ -63,7 +63,7 @@ public final class UnixDateTime implements IEquatable<UnixDateTime> {
|
||||
}
|
||||
|
||||
/**
|
||||
* <see cref="object.Equals(object)" /> overload.
|
||||
* {@link object.Equals(object)} overload.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
@@ -75,7 +75,7 @@ public final class UnixDateTime implements IEquatable<UnixDateTime> {
|
||||
}
|
||||
|
||||
/**
|
||||
* <see cref="object.GetHashCode" /> overload.
|
||||
* {@link object.GetHashCode} overload.
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
|
||||
@@ -0,0 +1,134 @@
|
||||
//------------------------------------------------------------
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//------------------------------------------------------------
|
||||
|
||||
package com.azure.data.cosmos.serialization.hybridrow.internal;
|
||||
|
||||
import com.google.common.base.Utf8;
|
||||
import com.google.common.hash.HashCode;
|
||||
import com.google.common.hash.HashFunction;
|
||||
import com.google.common.hash.Hashing;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.ByteBufAllocator;
|
||||
import io.netty.buffer.Unpooled;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.concurrent.Immutable;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
import static com.google.common.base.Strings.lenientFormat;
|
||||
import static java.nio.charset.StandardCharsets.UTF_8;
|
||||
|
||||
/**
|
||||
* Murmur3Hash for x64 (Little Endian).
|
||||
* <p>Reference: https: //en.wikipedia.org/wiki/MurmurHash <br /></p>
|
||||
* <p>
|
||||
* This implementation provides span-based access for hashing content not available in a
|
||||
* {@link T:byte[]}
|
||||
* </p>
|
||||
*/
|
||||
@SuppressWarnings("UnstableApiUsage")
|
||||
@Immutable
|
||||
public final class Murmur3Hash {
|
||||
|
||||
private static final ByteBufAllocator allocator = ByteBufAllocator.DEFAULT;
|
||||
private static final ByteBuf FALSE = Constant.add(false);
|
||||
private static final ByteBuf TRUE = Constant.add(true);
|
||||
private static final ByteBuf EMPTY_STRING = Constant.add("");
|
||||
|
||||
/**
|
||||
* Computes a 128-bit Murmur3Hash 128-bit value for a data item
|
||||
*
|
||||
* @param item The data to hash
|
||||
* @param seed The seed with which to initialize
|
||||
* @return The 128-bit hash represented as two 64-bit words encapsulated by a {@link Code} instance
|
||||
*/
|
||||
public static Code Hash128(@Nonnull final String item, @Nonnull final Code seed) {
|
||||
|
||||
checkNotNull(item, "value: null, seed: %s", seed);
|
||||
checkNotNull(seed, "value: %s, seed: null", item);
|
||||
|
||||
if (item.isEmpty()) {
|
||||
Hash128(EMPTY_STRING, seed);
|
||||
}
|
||||
|
||||
final int encodedLength = Utf8.encodedLength(item);
|
||||
ByteBuf buffer = allocator.buffer(encodedLength, encodedLength);
|
||||
|
||||
try {
|
||||
final int count = buffer.writeCharSequence(item, UTF_8);
|
||||
assert count == encodedLength : lenientFormat("count: %s, encodedLength: %s");
|
||||
return Hash128(buffer, seed);
|
||||
} finally {
|
||||
buffer.release();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Computes a 128-bit Murmur3Hash 128-bit value for a {@link boolean} data item
|
||||
*
|
||||
* @param item The data to hash
|
||||
* @param seed The seed with which to initialize
|
||||
* @return The 128-bit hash represented as two 64-bit words encapsulated by a {@link Code} instance
|
||||
*/
|
||||
public static Code Hash128(boolean item, Code seed) {
|
||||
return Murmur3Hash.Hash128(item ? TRUE : FALSE, seed);
|
||||
}
|
||||
|
||||
/**
|
||||
* Computes a 128-bit Murmur3Hash 128-bit value for a {@link ByteBuf} data item
|
||||
*
|
||||
* @param item The data to hash
|
||||
* @param seed The seed with which to initialize
|
||||
* @return The 128-bit hash represented as two 64-bit words encapsulated by a {@link Code} instance
|
||||
*/
|
||||
public static Code Hash128(ByteBuf item, Code seed) {
|
||||
// TODO: DANOBLE: Fork and update or hack murmur3_128 to support a 128-bit seed value or push for a 32-bit seed
|
||||
HashFunction hashFunction = Hashing.murmur3_128(Long.valueOf(seed.high | 0xFFFFFFFFL).intValue());
|
||||
HashCode hashCode = hashFunction.hashBytes(item.array());
|
||||
return new Code(hashCode);
|
||||
}
|
||||
|
||||
@Immutable
|
||||
public static final class Code {
|
||||
|
||||
public final long low, high;
|
||||
|
||||
public Code(long low, long high) {
|
||||
this.low = low;
|
||||
this.high = high;
|
||||
}
|
||||
|
||||
private Code(HashCode hashCode) {
|
||||
ByteBuf buffer = Unpooled.wrappedBuffer(hashCode.asBytes());
|
||||
this.low = buffer.readLongLE();
|
||||
this.high = buffer.readLongLE();
|
||||
}
|
||||
}
|
||||
|
||||
private static final class Constant {
|
||||
|
||||
private static ByteBuf constants = allocator.heapBuffer();
|
||||
|
||||
private Constant() {
|
||||
}
|
||||
|
||||
static ByteBuf add(final boolean value) {
|
||||
final int start = constants.writerIndex();
|
||||
constants.writeByte(value ? 1 : 0);
|
||||
return constants.slice(start, Byte.BYTES).asReadOnly();
|
||||
}
|
||||
|
||||
static ByteBuf add(final String value) {
|
||||
|
||||
final int start = constants.writerIndex();
|
||||
final int encodedLength = Utf8.encodedLength(value);
|
||||
final ByteBuf buffer = allocator.buffer(encodedLength, encodedLength);
|
||||
|
||||
final int count = buffer.writeCharSequence(value, UTF_8);
|
||||
assert count == encodedLength : lenientFormat("count: %s, encodedLength: %s");
|
||||
|
||||
return constants.slice(start, encodedLength);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,255 +0,0 @@
|
||||
//------------------------------------------------------------
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//------------------------------------------------------------
|
||||
|
||||
package com.azure.data.cosmos.serialization.hybridrow.internal;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkArgument;
|
||||
|
||||
/**
|
||||
* MurmurHash3 for x64 (Little Endian).
|
||||
* <p>Reference: https: //en.wikipedia.org/wiki/MurmurHash <br /></p>
|
||||
* <p>
|
||||
* This implementation provides span-based access for hashing content not available in a
|
||||
* <see cref="T:byte[]" />
|
||||
* </p>
|
||||
*/
|
||||
public final class MurmurHash3 {
|
||||
/** MurmurHash3 128-bit implementation.
|
||||
@param value The data to hash.
|
||||
@param seed The seed to initialize with.
|
||||
@return The 128-bit hash represented as two 64-bit words.
|
||||
*/
|
||||
// TODO: C# TO JAVA CONVERTER: Methods returning tuples are not converted by C# to Java Converter:
|
||||
public static Value Hash128(String value, Value seed) {
|
||||
checkArgument(value != null);
|
||||
int size = Encoding.UTF8.GetMaxByteCount(value.length());
|
||||
Span<byte> span = size <= 256 ? stackalloc byte[size] :new byte[size];
|
||||
int len = Encoding.UTF8.GetBytes(value.AsSpan(), span);
|
||||
return MurmurHash3.Hash128(span.Slice(0, len), seed);
|
||||
}
|
||||
|
||||
/** MurmurHash3 128-bit implementation.
|
||||
@param value The data to hash.
|
||||
@param seed The seed to initialize with.
|
||||
@return The 128-bit hash represented as two 64-bit words.
|
||||
*/
|
||||
// TODO: C# TO JAVA CONVERTER: Methods returning tuples are not converted by C# to Java Converter:
|
||||
public static Value Hash128(boolean value, Value seed) {
|
||||
// Ensure that a bool is ALWAYS a single byte encoding with 1 for true and 0 for false.
|
||||
return MurmurHash3.Hash128((byte)(value ? 1 : 0), seed);
|
||||
}
|
||||
|
||||
/** MurmurHash3 128-bit implementation.
|
||||
@param value The data to hash.
|
||||
@param seed The seed to initialize with.
|
||||
@return The 128-bit hash represented as two 64-bit words.
|
||||
*/
|
||||
// TODO: C# TO JAVA CONVERTER: Methods returning tuples are not converted by C# to Java Converter:
|
||||
// public static unsafe(ulong low, ulong high) Hash128<T>(T value, (ulong high, ulong low) seed) where T :
|
||||
// unmanaged
|
||||
// {
|
||||
// ReadOnlySpan<T> span = new ReadOnlySpan<T>(&value, 1);
|
||||
// return MurmurHash3.Hash128(MemoryMarshal.AsBytes(span), seed);
|
||||
// }
|
||||
|
||||
/**
|
||||
* MurmurHash3 128-bit implementation.
|
||||
*
|
||||
* @param span The data to hash.
|
||||
* @param seed The seed to initialize with.
|
||||
* @return The 128-bit hash represented as two 64-bit words.
|
||||
*/
|
||||
// TODO: C# TO JAVA CONVERTER: Methods returning tuples are not converted by C# to Java Converter:
|
||||
// public static unsafe(ulong low, ulong high) Hash128(ReadOnlySpan<byte> span, (ulong high, ulong low) seed)
|
||||
// {
|
||||
// Contract.Assert(BitConverter.IsLittleEndian, "Little Endian expected");
|
||||
// const ulong c1 = 0x87c37b91114253d5;
|
||||
// const ulong c2 = 0x4cf5ad432745937f;
|
||||
//
|
||||
// (ulong h1, ulong h2) = seed;
|
||||
//
|
||||
// // body
|
||||
// unchecked
|
||||
// {
|
||||
// fixed (byte* words = span)
|
||||
// {
|
||||
// int position;
|
||||
// for (position = 0; position < span.Length - 15; position += 16)
|
||||
// {
|
||||
// ulong k1 = *(ulong*)(words + position);
|
||||
// ulong k2 = *(ulong*)(words + position + 8);
|
||||
//
|
||||
// // k1, h1
|
||||
// k1 *= c1;
|
||||
// k1 = MurmurHash3.RotateLeft64(k1, 31);
|
||||
// k1 *= c2;
|
||||
//
|
||||
// h1 ^= k1;
|
||||
// h1 = MurmurHash3.RotateLeft64(h1, 27);
|
||||
// h1 += h2;
|
||||
// h1 = (h1 * 5) + 0x52dce729;
|
||||
//
|
||||
// // k2, h2
|
||||
// k2 *= c2;
|
||||
// k2 = MurmurHash3.RotateLeft64(k2, 33);
|
||||
// k2 *= c1;
|
||||
//
|
||||
// h2 ^= k2;
|
||||
// h2 = MurmurHash3.RotateLeft64(h2, 31);
|
||||
// h2 += h1;
|
||||
// h2 = (h2 * 5) + 0x38495ab5;
|
||||
// }
|
||||
//
|
||||
// {
|
||||
// // tail
|
||||
// ulong k1 = 0;
|
||||
// ulong k2 = 0;
|
||||
//
|
||||
// int n = span.Length & 15;
|
||||
// if (n >= 15)
|
||||
// {
|
||||
// k2 ^= (ulong)words[position + 14] << 48;
|
||||
// }
|
||||
//
|
||||
// if (n >= 14)
|
||||
// {
|
||||
// k2 ^= (ulong)words[position + 13] << 40;
|
||||
// }
|
||||
//
|
||||
// if (n >= 13)
|
||||
// {
|
||||
// k2 ^= (ulong)words[position + 12] << 32;
|
||||
// }
|
||||
//
|
||||
// if (n >= 12)
|
||||
// {
|
||||
// k2 ^= (ulong)words[position + 11] << 24;
|
||||
// }
|
||||
//
|
||||
// if (n >= 11)
|
||||
// {
|
||||
// k2 ^= (ulong)words[position + 10] << 16;
|
||||
// }
|
||||
//
|
||||
// if (n >= 10)
|
||||
// {
|
||||
// k2 ^= (ulong)words[position + 09] << 8;
|
||||
// }
|
||||
//
|
||||
// if (n >= 9)
|
||||
// {
|
||||
// k2 ^= (ulong)words[position + 08] << 0;
|
||||
// }
|
||||
//
|
||||
// k2 *= c2;
|
||||
// k2 = MurmurHash3.RotateLeft64(k2, 33);
|
||||
// k2 *= c1;
|
||||
// h2 ^= k2;
|
||||
//
|
||||
// if (n >= 8)
|
||||
// {
|
||||
// k1 ^= (ulong)words[position + 7] << 56;
|
||||
// }
|
||||
//
|
||||
// if (n >= 7)
|
||||
// {
|
||||
// k1 ^= (ulong)words[position + 6] << 48;
|
||||
// }
|
||||
//
|
||||
// if (n >= 6)
|
||||
// {
|
||||
// k1 ^= (ulong)words[position + 5] << 40;
|
||||
// }
|
||||
//
|
||||
// if (n >= 5)
|
||||
// {
|
||||
// k1 ^= (ulong)words[position + 4] << 32;
|
||||
// }
|
||||
//
|
||||
// if (n >= 4)
|
||||
// {
|
||||
// k1 ^= (ulong)words[position + 3] << 24;
|
||||
// }
|
||||
//
|
||||
// if (n >= 3)
|
||||
// {
|
||||
// k1 ^= (ulong)words[position + 2] << 16;
|
||||
// }
|
||||
//
|
||||
// if (n >= 2)
|
||||
// {
|
||||
// k1 ^= (ulong)words[position + 1] << 8;
|
||||
// }
|
||||
//
|
||||
// if (n >= 1)
|
||||
// {
|
||||
// k1 ^= (ulong)words[position + 0] << 0;
|
||||
// }
|
||||
//
|
||||
// k1 *= c1;
|
||||
// k1 = MurmurHash3.RotateLeft64(k1, 31);
|
||||
// k1 *= c2;
|
||||
// h1 ^= k1;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// // finalization
|
||||
// h1 ^= (ulong)span.Length;
|
||||
// h2 ^= (ulong)span.Length;
|
||||
// h1 += h2;
|
||||
// h2 += h1;
|
||||
// h1 = MurmurHash3.Mix(h1);
|
||||
// h2 = MurmurHash3.Mix(h2);
|
||||
// h1 += h2;
|
||||
// h2 += h1;
|
||||
// }
|
||||
//
|
||||
// return (h1, h2);
|
||||
// }
|
||||
|
||||
// TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes:
|
||||
//ORIGINAL LINE: [MethodImpl(MethodImplOptions.AggressiveInlining)] private static ulong Mix(ulong h)
|
||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||
//ORIGINAL LINE: [MethodImpl(MethodImplOptions.AggressiveInlining)] private static ulong Mix(ulong h)
|
||||
private static long Mix(long h) {
|
||||
// TODO: C# TO JAVA CONVERTER: There is no equivalent to an 'unchecked' block in Java:
|
||||
//C# TO JAVA CONVERTER WARNING: The right shift operator was replaced by Java's logical right shift
|
||||
// operator since the left operand was originally of an unsigned type, but you should confirm this
|
||||
// replacement:
|
||||
h ^= h >>> 33;
|
||||
h *= 0xff51afd7ed558ccdL;
|
||||
//C# TO JAVA CONVERTER WARNING: The right shift operator was replaced by Java's logical right shift
|
||||
// operator since the left operand was originally of an unsigned type, but you should confirm this
|
||||
// replacement:
|
||||
h ^= h >>> 33;
|
||||
h *= 0xc4ceb9fe1a85ec53L;
|
||||
//C# TO JAVA CONVERTER WARNING: The right shift operator was replaced by Java's logical right shift
|
||||
// operator since the left operand was originally of an unsigned type, but you should confirm this replacement:
|
||||
h ^= h >>> 33;
|
||||
return h;
|
||||
}
|
||||
|
||||
// TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes:
|
||||
//ORIGINAL LINE: [MethodImpl(MethodImplOptions.AggressiveInlining)] private static ulong RotateLeft64(ulong n,
|
||||
// int numBits)
|
||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||
//ORIGINAL LINE: [MethodImpl(MethodImplOptions.AggressiveInlining)] private static ulong RotateLeft64(ulong n,
|
||||
// int numBits)
|
||||
private static long RotateLeft64(long n, int numBits) {
|
||||
checkArgument(numBits < 64, "numBits < 64");
|
||||
//C# TO JAVA CONVERTER WARNING: The right shift operator was replaced by Java's logical right shift operator
|
||||
// since the left operand was originally of an unsigned type, but you should confirm this replacement:
|
||||
return (n << numBits) | (n >>> (64 - numBits));
|
||||
}
|
||||
|
||||
public static final class Value {
|
||||
|
||||
public final long low, high;
|
||||
|
||||
public Value(long low, long high) {
|
||||
this.low = low;
|
||||
this.high = high;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
//------------------------------------------------------------
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//------------------------------------------------------------
|
||||
|
||||
package com.azure.data.cosmos.serialization.hybridrow.internal;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.core.JsonParser;
|
||||
import com.fasterxml.jackson.core.JsonToken;
|
||||
import com.fasterxml.jackson.databind.JsonDeserializer;
|
||||
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkArgument;
|
||||
|
||||
/**
|
||||
* Helper class for parsing <see cref="Utf8String" /> from JSON.
|
||||
*/
|
||||
public class Utf8StringJsonConverter extends StdSerializer<ByteBuf> {
|
||||
|
||||
public Utf8StringJsonConverter() {
|
||||
this(ByteBuf.class);
|
||||
}
|
||||
|
||||
public Utf8StringJsonConverter(Class<ByteBuf> type) {
|
||||
super(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canWrite() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean CanConvert(Class<?> type) {
|
||||
return type.isAssignableFrom(ByteBuf);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object ReadJson(
|
||||
JsonReader reader, java.lang.Class objectType, Object existingValue, JsonSerializer serializer) {
|
||||
checkArgument(reader.TokenType == JsonToken.String);
|
||||
return Utf8String.TranscodeUtf16((String)reader.Value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void WriteJson(JsonWriter writer, Object value, JsonSerializer serializer) {
|
||||
writer.WriteValue(((Utf8String)value).toString());
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,8 @@
|
||||
|
||||
package com.azure.data.cosmos.serialization.hybridrow.io;
|
||||
|
||||
import com.azure.data.cosmos.core.RefObject;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.Result;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.layouts.TypeArgument;
|
||||
|
||||
@@ -19,5 +20,5 @@ public interface IRowSerializable {
|
||||
* @param typeArg The schematized layout type, if a schema is available.
|
||||
* @return Success if the write is successful, the error code otherwise.
|
||||
*/
|
||||
Result write(RefObject<RowWriter> writer, TypeArgument typeArg);
|
||||
Result write(Reference<RowWriter> writer, TypeArgument typeArg);
|
||||
}
|
||||
@@ -4,8 +4,9 @@
|
||||
|
||||
package com.azure.data.cosmos.serialization.hybridrow.io;
|
||||
|
||||
import com.azure.data.cosmos.core.OutObject;
|
||||
import com.azure.data.cosmos.core.RefObject;
|
||||
import com.azure.data.cosmos.core.Out;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.Float128;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.NullValue;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.Result;
|
||||
@@ -55,21 +56,22 @@ import static com.google.common.base.Preconditions.checkState;
|
||||
|
||||
|
||||
/**
|
||||
* A forward-only, streaming, field reader for <see cref="RowBuffer" />.
|
||||
* A forward-only, streaming, field reader for {@link RowBuffer}.
|
||||
* <p>
|
||||
* A <see cref="RowReader" /> allows the traversal in a streaming, left to right fashion, of
|
||||
* A {@link RowReader} allows the traversal in a streaming, left to right fashion, of
|
||||
* an entire HybridRow. The row's layout provides decoding for any schematized portion of the row.
|
||||
* However, unschematized sparse fields are read directly from the sparse segment with or without
|
||||
* schematization allowing all fields within the row, both known and unknown, to be read.
|
||||
* <para />
|
||||
* Modifying a <see cref="RowBuffer" /> invalidates any reader or child reader associated with it. In
|
||||
* general <see cref="RowBuffer" />'s should not be mutated while being enumerated.
|
||||
* Modifying a {@link RowBuffer} invalidates any reader or child reader associated with it. In
|
||||
* general {@link RowBuffer}'s should not be mutated while being enumerated.
|
||||
*/
|
||||
//C# TO JAVA CONVERTER WARNING: Java does not allow user-defined value types. The behavior of this class may differ
|
||||
// from the original:
|
||||
//ORIGINAL LINE: public ref struct RowReader
|
||||
//C# TO JAVA CONVERTER WARNING: Java has no equivalent to the C# ref struct:
|
||||
public final class RowReader {
|
||||
|
||||
private int columnIndex;
|
||||
private ReadOnlySpan<LayoutColumn> columns;
|
||||
private RowCursor cursor = new RowCursor();
|
||||
@@ -79,35 +81,35 @@ public final class RowReader {
|
||||
private States state = States.values()[0];
|
||||
|
||||
/**
|
||||
* Initializes a new instance of the <see cref="RowReader" /> struct.
|
||||
* Initializes a new instance of the {@link RowReader} struct.
|
||||
*
|
||||
* @param row The row to be read.
|
||||
* @param scope The scope whose fields should be enumerated.
|
||||
* <p>
|
||||
* A <see cref="RowReader" /> instance traverses all of the top-level fields of a given
|
||||
* A {@link RowReader} instance traverses all of the top-level fields of a given
|
||||
* scope. If the root scope is provided then all top-level fields in the row are enumerated. Nested
|
||||
* child <see cref="RowReader" /> instances can be access through the <see cref="ReadScope" /> method
|
||||
* child {@link RowReader} instances can be access through the {@link ReadScope} method
|
||||
* to process nested content.
|
||||
*/
|
||||
public RowReader() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes a new instance of the <see cref="RowReader" /> struct.
|
||||
* Initializes a new instance of the {@link RowReader} struct.
|
||||
*
|
||||
* @param row The row to be read.
|
||||
* @param scope The scope whose fields should be enumerated.
|
||||
* <p>
|
||||
* A <see cref="RowReader" /> instance traverses all of the top-level fields of a given
|
||||
* A {@link RowReader} instance traverses all of the top-level fields of a given
|
||||
* scope. If the root scope is provided then all top-level fields in the row are enumerated. Nested
|
||||
* child <see cref="RowReader" /> instances can be access through the <see cref="ReadScope" /> method
|
||||
* child {@link RowReader} instances can be access through the {@link ReadScope} method
|
||||
* to process nested content.
|
||||
*/
|
||||
public RowReader(RefObject<RowBuffer> row) {
|
||||
public RowReader(Reference<RowBuffer> row) {
|
||||
this(row, RowCursor.Create(row));
|
||||
}
|
||||
|
||||
public RowReader(RefObject<RowBuffer> row, final Checkpoint checkpoint) {
|
||||
public RowReader(Reference<RowBuffer> row, final Checkpoint checkpoint) {
|
||||
this.row = row.get().clone();
|
||||
this.columns = checkpoint.Cursor.layout.getColumns();
|
||||
this.schematizedCount = checkpoint.Cursor.layout.getNumFixed() + checkpoint.Cursor.layout.getNumVariable();
|
||||
@@ -117,7 +119,7 @@ public final class RowReader {
|
||||
this.columnIndex = checkpoint.ColumnIndex;
|
||||
}
|
||||
|
||||
private RowReader(RefObject<RowBuffer> row, final RowCursor scope) {
|
||||
private RowReader(Reference<RowBuffer> row, final RowCursor scope) {
|
||||
this.cursor = scope.clone();
|
||||
this.row = row.get().clone();
|
||||
this.columns = this.cursor.layout.getColumns();
|
||||
@@ -140,16 +142,16 @@ public final class RowReader {
|
||||
return true;
|
||||
case Sparse:
|
||||
if (this.cursor.cellType instanceof LayoutNullable) {
|
||||
RefObject<RowCursor> tempRef_cursor =
|
||||
new RefObject<RowCursor>(this.cursor);
|
||||
RowCursor nullableScope = this.row.SparseIteratorReadScope(tempRef_cursor, true).clone();
|
||||
this.cursor = tempRef_cursor.get();
|
||||
RefObject<RowBuffer> tempRef_row =
|
||||
new RefObject<RowBuffer>(this.row);
|
||||
RefObject<RowCursor> tempRef_nullableScope = new RefObject<RowCursor>(nullableScope);
|
||||
boolean tempVar = LayoutNullable.HasValue(tempRef_row, tempRef_nullableScope) == Result.Success;
|
||||
nullableScope = tempRef_nullableScope.get();
|
||||
this.row = tempRef_row.get();
|
||||
Reference<RowCursor> tempReference_cursor =
|
||||
new Reference<RowCursor>(this.cursor);
|
||||
RowCursor nullableScope = this.row.SparseIteratorReadScope(tempReference_cursor, true).clone();
|
||||
this.cursor = tempReference_cursor.get();
|
||||
Reference<RowBuffer> tempReference_row =
|
||||
new Reference<RowBuffer>(this.row);
|
||||
Reference<RowCursor> tempReference_nullableScope = new Reference<RowCursor>(nullableScope);
|
||||
boolean tempVar = LayoutNullable.HasValue(tempReference_row, tempReference_nullableScope) == Result.Success;
|
||||
nullableScope = tempReference_nullableScope.get();
|
||||
this.row = tempReference_row.get();
|
||||
return tempVar;
|
||||
}
|
||||
|
||||
@@ -163,7 +165,7 @@ public final class RowReader {
|
||||
* The 0-based index, relative to the start of the scope, of the field (if positioned on a
|
||||
* field, undefined otherwise).
|
||||
* <p>
|
||||
* When enumerating a non-indexed scope, this value is always 0 (see <see cref="Path" />).
|
||||
* When enumerating a non-indexed scope, this value is always 0 (see {@link Path}).
|
||||
*/
|
||||
public int getIndex() {
|
||||
switch (this.state) {
|
||||
@@ -187,7 +189,7 @@ public final class RowReader {
|
||||
* The path, relative to the scope, of the field (if positioned on a field, undefined
|
||||
* otherwise).
|
||||
* <p>
|
||||
* When enumerating an indexed scope, this value is always null (see <see cref="Index" />).
|
||||
* When enumerating an indexed scope, this value is always null (see {@link Index}).
|
||||
*/
|
||||
public UtfAnyString getPath() {
|
||||
switch (this.state) {
|
||||
@@ -198,10 +200,10 @@ public final class RowReader {
|
||||
return null;
|
||||
}
|
||||
|
||||
RefObject<RowCursor> tempRef_cursor =
|
||||
new RefObject<RowCursor>(this.cursor);
|
||||
Utf8Span span = this.row.ReadSparsePath(tempRef_cursor);
|
||||
this.cursor = tempRef_cursor.get();
|
||||
Reference<RowCursor> tempReference_cursor =
|
||||
new Reference<RowCursor>(this.cursor);
|
||||
Utf8Span span = this.row.ReadSparsePath(tempReference_cursor);
|
||||
this.cursor = tempReference_cursor.get();
|
||||
return Utf8String.CopyFrom(span);
|
||||
default:
|
||||
return null;
|
||||
@@ -212,17 +214,17 @@ public final class RowReader {
|
||||
* The path, relative to the scope, of the field (if positioned on a field, undefined
|
||||
* otherwise).
|
||||
* <p>
|
||||
* When enumerating an indexed scope, this value is always null (see <see cref="Index" />).
|
||||
* When enumerating an indexed scope, this value is always null (see {@link Index}).
|
||||
*/
|
||||
public Utf8Span getPathSpan() {
|
||||
switch (this.state) {
|
||||
case Schematized:
|
||||
return this.columns[this.columnIndex].Path.Span;
|
||||
case Sparse:
|
||||
RefObject<RowCursor> tempRef_cursor =
|
||||
new RefObject<RowCursor>(this.cursor);
|
||||
Utf8Span tempVar = this.row.ReadSparsePath(tempRef_cursor);
|
||||
this.cursor = tempRef_cursor.get();
|
||||
Reference<RowCursor> tempReference_cursor =
|
||||
new Reference<RowCursor>(this.cursor);
|
||||
Utf8Span tempVar = this.row.ReadSparsePath(tempReference_cursor);
|
||||
this.cursor = tempReference_cursor.get();
|
||||
return tempVar;
|
||||
default:
|
||||
return null;
|
||||
@@ -314,16 +316,16 @@ public final class RowReader {
|
||||
|
||||
case Sparse: {
|
||||
|
||||
RefObject<RowBuffer> tempRef_row = new RefObject<RowBuffer>(this.row);
|
||||
Reference<RowBuffer> tempReference_row = new Reference<RowBuffer>(this.row);
|
||||
|
||||
if (!RowCursorExtensions.MoveNext(this.cursor.clone(),
|
||||
tempRef_row)) {
|
||||
this.row = tempRef_row.get();
|
||||
tempReference_row)) {
|
||||
this.row = tempReference_row.get();
|
||||
this.state = States.Done;
|
||||
// TODO: C# TO JAVA CONVERTER: There is no 'goto' in Java:
|
||||
// goto case States.Done;
|
||||
} else {
|
||||
this.row = tempRef_row.get();
|
||||
this.row = tempReference_row.get();
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -345,10 +347,10 @@ public final class RowReader {
|
||||
*/
|
||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||
//ORIGINAL LINE: public Result ReadBinary(out byte[] value)
|
||||
public Result ReadBinary(OutObject<byte[]> value) {
|
||||
public Result ReadBinary(Out<byte[]> value) {
|
||||
ReadOnlySpan<Byte> span;
|
||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
|
||||
// cannot be converted using the 'OutObject' helper class unless the method is within the code being modified:
|
||||
// cannot be converted using the 'Out' helper class unless the method is within the code being modified:
|
||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||
//ORIGINAL LINE: Result r = this.ReadBinary(out ReadOnlySpan<byte> span);
|
||||
Result r = this.ReadBinary(out span);
|
||||
@@ -365,7 +367,7 @@ public final class RowReader {
|
||||
*/
|
||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||
//ORIGINAL LINE: public Result ReadBinary(out ReadOnlySpan<byte> value)
|
||||
public Result ReadBinary(OutObject<ReadOnlySpan<Byte>> value) {
|
||||
public Result ReadBinary(Out<ReadOnlySpan<Byte>> value) {
|
||||
switch (this.state) {
|
||||
case Schematized:
|
||||
return this.ReadPrimitiveValue(value);
|
||||
@@ -375,10 +377,10 @@ public final class RowReader {
|
||||
return Result.TypeMismatch;
|
||||
}
|
||||
|
||||
RefObject<RowCursor> tempRef_cursor =
|
||||
new RefObject<RowCursor>(this.cursor);
|
||||
value.set(this.row.ReadSparseBinary(tempRef_cursor));
|
||||
this.cursor = tempRef_cursor.get();
|
||||
Reference<RowCursor> tempReference_cursor =
|
||||
new Reference<RowCursor>(this.cursor);
|
||||
value.set(this.row.ReadSparseBinary(tempReference_cursor));
|
||||
this.cursor = tempReference_cursor.get();
|
||||
return Result.Success;
|
||||
default:
|
||||
value.set(null);
|
||||
@@ -387,12 +389,12 @@ public final class RowReader {
|
||||
}
|
||||
|
||||
/**
|
||||
* Read the current field as a <see cref="bool" />.
|
||||
* Read the current field as a {@link bool}.
|
||||
*
|
||||
* @param value On success, receives the value, undefined otherwise.
|
||||
* @return Success if the read is successful, an error code otherwise.
|
||||
*/
|
||||
public Result ReadBool(OutObject<Boolean> value) {
|
||||
public Result ReadBool(Out<Boolean> value) {
|
||||
switch (this.state) {
|
||||
case Schematized:
|
||||
return this.ReadPrimitiveValue(value);
|
||||
@@ -402,10 +404,10 @@ public final class RowReader {
|
||||
return Result.TypeMismatch;
|
||||
}
|
||||
|
||||
RefObject<RowCursor> tempRef_cursor =
|
||||
new RefObject<RowCursor>(this.cursor);
|
||||
value.set(this.row.ReadSparseBool(tempRef_cursor));
|
||||
this.cursor = tempRef_cursor.get();
|
||||
Reference<RowCursor> tempReference_cursor =
|
||||
new Reference<RowCursor>(this.cursor);
|
||||
value.set(this.row.ReadSparseBool(tempReference_cursor));
|
||||
this.cursor = tempReference_cursor.get();
|
||||
return Result.Success;
|
||||
default:
|
||||
value.set(false);
|
||||
@@ -414,12 +416,12 @@ public final class RowReader {
|
||||
}
|
||||
|
||||
/**
|
||||
* Read the current field as a fixed length <see cref="DateTime" /> value.
|
||||
* Read the current field as a fixed length {@link DateTime} value.
|
||||
*
|
||||
* @param value On success, receives the value, undefined otherwise.
|
||||
* @return Success if the read is successful, an error code otherwise.
|
||||
*/
|
||||
public Result ReadDateTime(OutObject<LocalDateTime> value) {
|
||||
public Result ReadDateTime(Out<LocalDateTime> value) {
|
||||
switch (this.state) {
|
||||
case Schematized:
|
||||
return this.ReadPrimitiveValue(value);
|
||||
@@ -429,10 +431,10 @@ public final class RowReader {
|
||||
return Result.TypeMismatch;
|
||||
}
|
||||
|
||||
RefObject<RowCursor> tempRef_cursor =
|
||||
new RefObject<RowCursor>(this.cursor);
|
||||
value.set(this.row.ReadSparseDateTime(tempRef_cursor));
|
||||
this.cursor = tempRef_cursor.get();
|
||||
Reference<RowCursor> tempReference_cursor =
|
||||
new Reference<RowCursor>(this.cursor);
|
||||
value.set(this.row.ReadSparseDateTime(tempReference_cursor));
|
||||
this.cursor = tempReference_cursor.get();
|
||||
return Result.Success;
|
||||
default:
|
||||
value.set(LocalDateTime.MIN);
|
||||
@@ -441,12 +443,12 @@ public final class RowReader {
|
||||
}
|
||||
|
||||
/**
|
||||
* Read the current field as a fixed length <see cref="decimal" /> value.
|
||||
* Read the current field as a fixed length {@link decimal} value.
|
||||
*
|
||||
* @param value On success, receives the value, undefined otherwise.
|
||||
* @return Success if the read is successful, an error code otherwise.
|
||||
*/
|
||||
public Result ReadDecimal(OutObject<BigDecimal> value) {
|
||||
public Result ReadDecimal(Out<BigDecimal> value) {
|
||||
switch (this.state) {
|
||||
case Schematized:
|
||||
return this.ReadPrimitiveValue(value);
|
||||
@@ -456,10 +458,10 @@ public final class RowReader {
|
||||
return Result.TypeMismatch;
|
||||
}
|
||||
|
||||
RefObject<RowCursor> tempRef_cursor =
|
||||
new RefObject<RowCursor>(this.cursor);
|
||||
value.set(this.row.ReadSparseDecimal(tempRef_cursor));
|
||||
this.cursor = tempRef_cursor.get();
|
||||
Reference<RowCursor> tempReference_cursor =
|
||||
new Reference<RowCursor>(this.cursor);
|
||||
value.set(this.row.ReadSparseDecimal(tempReference_cursor));
|
||||
this.cursor = tempReference_cursor.get();
|
||||
return Result.Success;
|
||||
default:
|
||||
value.set(new BigDecimal(0));
|
||||
@@ -473,7 +475,7 @@ public final class RowReader {
|
||||
* @param value On success, receives the value, undefined otherwise.
|
||||
* @return Success if the read is successful, an error code otherwise.
|
||||
*/
|
||||
public Result ReadFloat128(OutObject<Float128> value) {
|
||||
public Result ReadFloat128(Out<Float128> value) {
|
||||
switch (this.state) {
|
||||
case Schematized:
|
||||
return this.ReadPrimitiveValue(value.clone());
|
||||
@@ -483,10 +485,10 @@ public final class RowReader {
|
||||
return Result.TypeMismatch;
|
||||
}
|
||||
|
||||
RefObject<RowCursor> tempRef_cursor =
|
||||
new RefObject<RowCursor>(this.cursor);
|
||||
value.set(this.row.ReadSparseFloat128(tempRef_cursor).clone());
|
||||
this.cursor = tempRef_cursor.get();
|
||||
Reference<RowCursor> tempReference_cursor =
|
||||
new Reference<RowCursor>(this.cursor);
|
||||
value.set(this.row.ReadSparseFloat128(tempReference_cursor).clone());
|
||||
this.cursor = tempReference_cursor.get();
|
||||
return Result.Success;
|
||||
default:
|
||||
value.set(null);
|
||||
@@ -500,7 +502,7 @@ public final class RowReader {
|
||||
* @param value On success, receives the value, undefined otherwise.
|
||||
* @return Success if the read is successful, an error code otherwise.
|
||||
*/
|
||||
public Result ReadFloat32(OutObject<Float> value) {
|
||||
public Result ReadFloat32(Out<Float> value) {
|
||||
switch (this.state) {
|
||||
case Schematized:
|
||||
return this.ReadPrimitiveValue(value);
|
||||
@@ -510,10 +512,10 @@ public final class RowReader {
|
||||
return Result.TypeMismatch;
|
||||
}
|
||||
|
||||
RefObject<RowCursor> tempRef_cursor =
|
||||
new RefObject<RowCursor>(this.cursor);
|
||||
value.set(this.row.ReadSparseFloat32(tempRef_cursor));
|
||||
this.cursor = tempRef_cursor.get();
|
||||
Reference<RowCursor> tempReference_cursor =
|
||||
new Reference<RowCursor>(this.cursor);
|
||||
value.set(this.row.ReadSparseFloat32(tempReference_cursor));
|
||||
this.cursor = tempReference_cursor.get();
|
||||
return Result.Success;
|
||||
default:
|
||||
value.set(0);
|
||||
@@ -527,7 +529,7 @@ public final class RowReader {
|
||||
* @param value On success, receives the value, undefined otherwise.
|
||||
* @return Success if the read is successful, an error code otherwise.
|
||||
*/
|
||||
public Result ReadFloat64(OutObject<Double> value) {
|
||||
public Result ReadFloat64(Out<Double> value) {
|
||||
switch (this.state) {
|
||||
case Schematized:
|
||||
return this.ReadPrimitiveValue(value);
|
||||
@@ -537,10 +539,10 @@ public final class RowReader {
|
||||
return Result.TypeMismatch;
|
||||
}
|
||||
|
||||
RefObject<RowCursor> tempRef_cursor =
|
||||
new RefObject<RowCursor>(this.cursor);
|
||||
value.set(this.row.ReadSparseFloat64(tempRef_cursor));
|
||||
this.cursor = tempRef_cursor.get();
|
||||
Reference<RowCursor> tempReference_cursor =
|
||||
new Reference<RowCursor>(this.cursor);
|
||||
value.set(this.row.ReadSparseFloat64(tempReference_cursor));
|
||||
this.cursor = tempReference_cursor.get();
|
||||
return Result.Success;
|
||||
default:
|
||||
value.set(0);
|
||||
@@ -549,12 +551,12 @@ public final class RowReader {
|
||||
}
|
||||
|
||||
/**
|
||||
* Read the current field as a fixed length <see cref="Guid" /> value.
|
||||
* Read the current field as a fixed length {@link Guid} value.
|
||||
*
|
||||
* @param value On success, receives the value, undefined otherwise.
|
||||
* @return Success if the read is successful, an error code otherwise.
|
||||
*/
|
||||
public Result ReadGuid(OutObject<UUID> value) {
|
||||
public Result ReadGuid(Out<UUID> value) {
|
||||
switch (this.state) {
|
||||
case Schematized:
|
||||
return this.ReadPrimitiveValue(value);
|
||||
@@ -564,10 +566,10 @@ public final class RowReader {
|
||||
return Result.TypeMismatch;
|
||||
}
|
||||
|
||||
RefObject<RowCursor> tempRef_cursor =
|
||||
new RefObject<RowCursor>(this.cursor);
|
||||
value.set(this.row.ReadSparseGuid(tempRef_cursor));
|
||||
this.cursor = tempRef_cursor.get();
|
||||
Reference<RowCursor> tempReference_cursor =
|
||||
new Reference<RowCursor>(this.cursor);
|
||||
value.set(this.row.ReadSparseGuid(tempReference_cursor));
|
||||
this.cursor = tempReference_cursor.get();
|
||||
return Result.Success;
|
||||
default:
|
||||
value.set(null);
|
||||
@@ -581,7 +583,7 @@ public final class RowReader {
|
||||
* @param value On success, receives the value, undefined otherwise.
|
||||
* @return Success if the read is successful, an error code otherwise.
|
||||
*/
|
||||
public Result ReadInt16(OutObject<Short> value) {
|
||||
public Result ReadInt16(Out<Short> value) {
|
||||
switch (this.state) {
|
||||
case Schematized:
|
||||
return this.ReadPrimitiveValue(value);
|
||||
@@ -591,10 +593,10 @@ public final class RowReader {
|
||||
return Result.TypeMismatch;
|
||||
}
|
||||
|
||||
RefObject<RowCursor> tempRef_cursor =
|
||||
new RefObject<RowCursor>(this.cursor);
|
||||
value.set(this.row.ReadSparseInt16(tempRef_cursor));
|
||||
this.cursor = tempRef_cursor.get();
|
||||
Reference<RowCursor> tempReference_cursor =
|
||||
new Reference<RowCursor>(this.cursor);
|
||||
value.set(this.row.ReadSparseInt16(tempReference_cursor));
|
||||
this.cursor = tempReference_cursor.get();
|
||||
return Result.Success;
|
||||
default:
|
||||
value.set(0);
|
||||
@@ -608,7 +610,7 @@ public final class RowReader {
|
||||
* @param value On success, receives the value, undefined otherwise.
|
||||
* @return Success if the read is successful, an error code otherwise.
|
||||
*/
|
||||
public Result ReadInt32(OutObject<Integer> value) {
|
||||
public Result ReadInt32(Out<Integer> value) {
|
||||
switch (this.state) {
|
||||
case Schematized:
|
||||
return this.ReadPrimitiveValue(value);
|
||||
@@ -618,10 +620,10 @@ public final class RowReader {
|
||||
return Result.TypeMismatch;
|
||||
}
|
||||
|
||||
RefObject<RowCursor> tempRef_cursor =
|
||||
new RefObject<RowCursor>(this.cursor);
|
||||
value.set(this.row.ReadSparseInt32(tempRef_cursor));
|
||||
this.cursor = tempRef_cursor.get();
|
||||
Reference<RowCursor> tempReference_cursor =
|
||||
new Reference<RowCursor>(this.cursor);
|
||||
value.set(this.row.ReadSparseInt32(tempReference_cursor));
|
||||
this.cursor = tempReference_cursor.get();
|
||||
return Result.Success;
|
||||
default:
|
||||
value.set(0);
|
||||
@@ -635,7 +637,7 @@ public final class RowReader {
|
||||
* @param value On success, receives the value, undefined otherwise.
|
||||
* @return Success if the read is successful, an error code otherwise.
|
||||
*/
|
||||
public Result ReadInt64(OutObject<Long> value) {
|
||||
public Result ReadInt64(Out<Long> value) {
|
||||
switch (this.state) {
|
||||
case Schematized:
|
||||
return this.ReadPrimitiveValue(value);
|
||||
@@ -645,10 +647,10 @@ public final class RowReader {
|
||||
return Result.TypeMismatch;
|
||||
}
|
||||
|
||||
RefObject<RowCursor> tempRef_cursor =
|
||||
new RefObject<RowCursor>(this.cursor);
|
||||
value.set(this.row.ReadSparseInt64(tempRef_cursor));
|
||||
this.cursor = tempRef_cursor.get();
|
||||
Reference<RowCursor> tempReference_cursor =
|
||||
new Reference<RowCursor>(this.cursor);
|
||||
value.set(this.row.ReadSparseInt64(tempReference_cursor));
|
||||
this.cursor = tempReference_cursor.get();
|
||||
return Result.Success;
|
||||
default:
|
||||
value.set(0);
|
||||
@@ -662,7 +664,7 @@ public final class RowReader {
|
||||
* @param value On success, receives the value, undefined otherwise.
|
||||
* @return Success if the read is successful, an error code otherwise.
|
||||
*/
|
||||
public Result ReadInt8(OutObject<Byte> value) {
|
||||
public Result ReadInt8(Out<Byte> value) {
|
||||
switch (this.state) {
|
||||
case Schematized:
|
||||
return this.ReadPrimitiveValue(value);
|
||||
@@ -672,10 +674,10 @@ public final class RowReader {
|
||||
return Result.TypeMismatch;
|
||||
}
|
||||
|
||||
RefObject<RowCursor> tempRef_cursor =
|
||||
new RefObject<RowCursor>(this.cursor);
|
||||
value.set(this.row.ReadSparseInt8(tempRef_cursor));
|
||||
this.cursor = tempRef_cursor.get();
|
||||
Reference<RowCursor> tempReference_cursor =
|
||||
new Reference<RowCursor>(this.cursor);
|
||||
value.set(this.row.ReadSparseInt8(tempReference_cursor));
|
||||
this.cursor = tempReference_cursor.get();
|
||||
return Result.Success;
|
||||
default:
|
||||
value.set(0);
|
||||
@@ -684,12 +686,12 @@ public final class RowReader {
|
||||
}
|
||||
|
||||
/**
|
||||
* Read the current field as a fixed length <see cref="MongoDbObjectId" /> value.
|
||||
* Read the current field as a fixed length {@link MongoDbObjectId} value.
|
||||
*
|
||||
* @param value On success, receives the value, undefined otherwise.
|
||||
* @return Success if the read is successful, an error code otherwise.
|
||||
*/
|
||||
public Result ReadMongoDbObjectId(OutObject<MongoDbObjectId> value) {
|
||||
public Result ReadMongoDbObjectId(Out<MongoDbObjectId> value) {
|
||||
switch (this.state) {
|
||||
case Schematized:
|
||||
return this.ReadPrimitiveValue(value.clone());
|
||||
@@ -699,10 +701,10 @@ public final class RowReader {
|
||||
return Result.TypeMismatch;
|
||||
}
|
||||
|
||||
RefObject<RowCursor> tempRef_cursor =
|
||||
new RefObject<RowCursor>(this.cursor);
|
||||
value.set(this.row.ReadSparseMongoDbObjectId(tempRef_cursor).clone());
|
||||
this.cursor = tempRef_cursor.get();
|
||||
Reference<RowCursor> tempReference_cursor =
|
||||
new Reference<RowCursor>(this.cursor);
|
||||
value.set(this.row.ReadSparseMongoDbObjectId(tempReference_cursor).clone());
|
||||
this.cursor = tempReference_cursor.get();
|
||||
return Result.Success;
|
||||
default:
|
||||
value.set(null);
|
||||
@@ -716,7 +718,7 @@ public final class RowReader {
|
||||
* @param value On success, receives the value, undefined otherwise.
|
||||
* @return Success if the read is successful, an error code otherwise.
|
||||
*/
|
||||
public Result ReadNull(OutObject<NullValue> value) {
|
||||
public Result ReadNull(Out<NullValue> value) {
|
||||
switch (this.state) {
|
||||
case Schematized:
|
||||
return this.ReadPrimitiveValue(value.clone());
|
||||
@@ -726,10 +728,10 @@ public final class RowReader {
|
||||
return Result.TypeMismatch;
|
||||
}
|
||||
|
||||
RefObject<RowCursor> tempRef_cursor =
|
||||
new RefObject<RowCursor>(this.cursor);
|
||||
value.set(this.row.ReadSparseNull(tempRef_cursor).clone());
|
||||
this.cursor = tempRef_cursor.get();
|
||||
Reference<RowCursor> tempReference_cursor =
|
||||
new Reference<RowCursor>(this.cursor);
|
||||
value.set(this.row.ReadSparseNull(tempReference_cursor).clone());
|
||||
this.cursor = tempReference_cursor.get();
|
||||
return Result.Success;
|
||||
default:
|
||||
value.set(null);
|
||||
@@ -746,15 +748,15 @@ public final class RowReader {
|
||||
* Nested child readers are independent of their parent.
|
||||
*/
|
||||
public RowReader ReadScope() {
|
||||
RefObject<RowCursor> tempRef_cursor =
|
||||
new RefObject<RowCursor>(this.cursor);
|
||||
RowCursor newScope = this.row.SparseIteratorReadScope(tempRef_cursor, true).clone();
|
||||
this.cursor = tempRef_cursor.get();
|
||||
RefObject<RowBuffer> tempRef_row =
|
||||
new RefObject<RowBuffer>(this.row);
|
||||
Reference<RowCursor> tempReference_cursor =
|
||||
new Reference<RowCursor>(this.cursor);
|
||||
RowCursor newScope = this.row.SparseIteratorReadScope(tempReference_cursor, true).clone();
|
||||
this.cursor = tempReference_cursor.get();
|
||||
Reference<RowBuffer> tempReference_row =
|
||||
new Reference<RowBuffer>(this.row);
|
||||
// TODO: C# TO JAVA CONVERTER: The following line could not be converted:
|
||||
return new RowReader(ref this.row, newScope)
|
||||
this.row = tempRef_row.get();
|
||||
this.row = tempReference_row.get();
|
||||
return tempVar;
|
||||
}
|
||||
|
||||
@@ -765,32 +767,32 @@ public final class RowReader {
|
||||
* objects, arrays, tuples, set, and maps.
|
||||
*/
|
||||
public <TContext> Result ReadScope(TContext context, ReaderFunc<TContext> func) {
|
||||
RefObject<RowCursor> tempRef_cursor =
|
||||
new RefObject<RowCursor>(this.cursor);
|
||||
RowCursor childScope = this.row.SparseIteratorReadScope(tempRef_cursor, true).clone();
|
||||
this.cursor = tempRef_cursor.get();
|
||||
RefObject<RowBuffer> tempRef_row =
|
||||
new RefObject<RowBuffer>(this.row);
|
||||
RowReader nestedReader = new RowReader(tempRef_row, childScope.clone());
|
||||
this.row = tempRef_row.get();
|
||||
Reference<RowCursor> tempReference_cursor =
|
||||
new Reference<RowCursor>(this.cursor);
|
||||
RowCursor childScope = this.row.SparseIteratorReadScope(tempReference_cursor, true).clone();
|
||||
this.cursor = tempReference_cursor.get();
|
||||
Reference<RowBuffer> tempReference_row =
|
||||
new Reference<RowBuffer>(this.row);
|
||||
RowReader nestedReader = new RowReader(tempReference_row, childScope.clone());
|
||||
this.row = tempReference_row.get();
|
||||
|
||||
RefObject<RowReader> tempRef_nestedReader =
|
||||
new RefObject<RowReader>(nestedReader);
|
||||
Reference<RowReader> tempReference_nestedReader =
|
||||
new Reference<RowReader>(nestedReader);
|
||||
// TODO: C# TO JAVA CONVERTER: The following line could not be converted:
|
||||
Result result = func == null ? null : func.Invoke(ref nestedReader, context) ??Result.Success;
|
||||
nestedReader = tempRef_nestedReader.get();
|
||||
nestedReader = tempReference_nestedReader.get();
|
||||
if (result != Result.Success) {
|
||||
return result;
|
||||
}
|
||||
|
||||
RefObject<RowBuffer> tempRef_row2 =
|
||||
new RefObject<RowBuffer>(this.row);
|
||||
RefObject<RowCursor> tempRef_cursor2 =
|
||||
new RefObject<RowCursor>(nestedReader.cursor);
|
||||
RowCursorExtensions.Skip(this.cursor.clone(), tempRef_row2,
|
||||
tempRef_cursor2);
|
||||
nestedReader.cursor = tempRef_cursor2.get();
|
||||
this.row = tempRef_row2.get();
|
||||
Reference<RowBuffer> tempReference_row2 =
|
||||
new Reference<RowBuffer>(this.row);
|
||||
Reference<RowCursor> tempReference_cursor2 =
|
||||
new Reference<RowCursor>(nestedReader.cursor);
|
||||
RowCursorExtensions.Skip(this.cursor.clone(), tempReference_row2,
|
||||
tempReference_cursor2);
|
||||
nestedReader.cursor = tempReference_cursor2.get();
|
||||
this.row = tempReference_row2.get();
|
||||
return Result.Success;
|
||||
}
|
||||
|
||||
@@ -800,10 +802,10 @@ public final class RowReader {
|
||||
* @param value On success, receives the value, undefined otherwise.
|
||||
* @return Success if the read is successful, an error code otherwise.
|
||||
*/
|
||||
public Result ReadString(OutObject<String> value) {
|
||||
public Result ReadString(Out<String> value) {
|
||||
Utf8Span span;
|
||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
|
||||
// cannot be converted using the 'OutObject' helper class unless the method is within the code being modified:
|
||||
// cannot be converted using the 'Out' helper class unless the method is within the code being modified:
|
||||
Result r = this.ReadString(out span);
|
||||
value.set((r == Result.Success) ? span.toString() :)
|
||||
default
|
||||
@@ -816,10 +818,10 @@ public final class RowReader {
|
||||
* @param value On success, receives the value, undefined otherwise.
|
||||
* @return Success if the read is successful, an error code otherwise.
|
||||
*/
|
||||
public Result ReadString(OutObject<Utf8String> value) {
|
||||
public Result ReadString(Out<Utf8String> value) {
|
||||
Utf8Span span;
|
||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
|
||||
// cannot be converted using the 'OutObject' helper class unless the method is within the code being modified:
|
||||
// cannot be converted using the 'Out' helper class unless the method is within the code being modified:
|
||||
Result r = this.ReadString(out span);
|
||||
value.set((r == Result.Success) ? Utf8String.CopyFrom(span) :)
|
||||
default
|
||||
@@ -832,7 +834,7 @@ public final class RowReader {
|
||||
* @param value On success, receives the value, undefined otherwise.
|
||||
* @return Success if the read is successful, an error code otherwise.
|
||||
*/
|
||||
public Result ReadString(OutObject<Utf8Span> value) {
|
||||
public Result ReadString(Out<Utf8Span> value) {
|
||||
switch (this.state) {
|
||||
case Schematized:
|
||||
return this.ReadPrimitiveValue(value);
|
||||
@@ -842,10 +844,10 @@ public final class RowReader {
|
||||
return Result.TypeMismatch;
|
||||
}
|
||||
|
||||
RefObject<RowCursor> tempRef_cursor =
|
||||
new RefObject<RowCursor>(this.cursor);
|
||||
value.set(this.row.ReadSparseString(tempRef_cursor));
|
||||
this.cursor = tempRef_cursor.get();
|
||||
Reference<RowCursor> tempReference_cursor =
|
||||
new Reference<RowCursor>(this.cursor);
|
||||
value.set(this.row.ReadSparseString(tempReference_cursor));
|
||||
this.cursor = tempReference_cursor.get();
|
||||
return Result.Success;
|
||||
default:
|
||||
value.set(null);
|
||||
@@ -861,7 +863,7 @@ public final class RowReader {
|
||||
*/
|
||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||
//ORIGINAL LINE: public Result ReadUInt16(out ushort value)
|
||||
public Result ReadUInt16(OutObject<Short> value) {
|
||||
public Result ReadUInt16(Out<Short> value) {
|
||||
switch (this.state) {
|
||||
case Schematized:
|
||||
return this.ReadPrimitiveValue(value);
|
||||
@@ -871,10 +873,10 @@ public final class RowReader {
|
||||
return Result.TypeMismatch;
|
||||
}
|
||||
|
||||
RefObject<RowCursor> tempRef_cursor =
|
||||
new RefObject<RowCursor>(this.cursor);
|
||||
value.set(this.row.ReadSparseUInt16(tempRef_cursor));
|
||||
this.cursor = tempRef_cursor.get();
|
||||
Reference<RowCursor> tempReference_cursor =
|
||||
new Reference<RowCursor>(this.cursor);
|
||||
value.set(this.row.ReadSparseUInt16(tempReference_cursor));
|
||||
this.cursor = tempReference_cursor.get();
|
||||
return Result.Success;
|
||||
default:
|
||||
value.set(0);
|
||||
@@ -890,7 +892,7 @@ public final class RowReader {
|
||||
*/
|
||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||
//ORIGINAL LINE: public Result ReadUInt32(out uint value)
|
||||
public Result ReadUInt32(OutObject<Integer> value) {
|
||||
public Result ReadUInt32(Out<Integer> value) {
|
||||
switch (this.state) {
|
||||
case Schematized:
|
||||
return this.ReadPrimitiveValue(value);
|
||||
@@ -900,10 +902,10 @@ public final class RowReader {
|
||||
return Result.TypeMismatch;
|
||||
}
|
||||
|
||||
RefObject<RowCursor> tempRef_cursor =
|
||||
new RefObject<RowCursor>(this.cursor);
|
||||
value.set(this.row.ReadSparseUInt32(tempRef_cursor));
|
||||
this.cursor = tempRef_cursor.get();
|
||||
Reference<RowCursor> tempReference_cursor =
|
||||
new Reference<RowCursor>(this.cursor);
|
||||
value.set(this.row.ReadSparseUInt32(tempReference_cursor));
|
||||
this.cursor = tempReference_cursor.get();
|
||||
return Result.Success;
|
||||
default:
|
||||
value.set(0);
|
||||
@@ -919,7 +921,7 @@ public final class RowReader {
|
||||
*/
|
||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||
//ORIGINAL LINE: public Result ReadUInt64(out ulong value)
|
||||
public Result ReadUInt64(OutObject<Long> value) {
|
||||
public Result ReadUInt64(Out<Long> value) {
|
||||
switch (this.state) {
|
||||
case Schematized:
|
||||
return this.ReadPrimitiveValue(value);
|
||||
@@ -929,10 +931,10 @@ public final class RowReader {
|
||||
return Result.TypeMismatch;
|
||||
}
|
||||
|
||||
RefObject<RowCursor> tempRef_cursor =
|
||||
new RefObject<RowCursor>(this.cursor);
|
||||
value.set(this.row.ReadSparseUInt64(tempRef_cursor));
|
||||
this.cursor = tempRef_cursor.get();
|
||||
Reference<RowCursor> tempReference_cursor =
|
||||
new Reference<RowCursor>(this.cursor);
|
||||
value.set(this.row.ReadSparseUInt64(tempReference_cursor));
|
||||
this.cursor = tempReference_cursor.get();
|
||||
return Result.Success;
|
||||
default:
|
||||
value.set(0);
|
||||
@@ -948,7 +950,7 @@ public final class RowReader {
|
||||
*/
|
||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||
//ORIGINAL LINE: public Result ReadUInt8(out byte value)
|
||||
public Result ReadUInt8(OutObject<Byte> value) {
|
||||
public Result ReadUInt8(Out<Byte> value) {
|
||||
switch (this.state) {
|
||||
case Schematized:
|
||||
return this.ReadPrimitiveValue(value);
|
||||
@@ -958,10 +960,10 @@ public final class RowReader {
|
||||
return Result.TypeMismatch;
|
||||
}
|
||||
|
||||
RefObject<RowCursor> tempRef_cursor =
|
||||
new RefObject<RowCursor>(this.cursor);
|
||||
value.set(this.row.ReadSparseUInt8(tempRef_cursor));
|
||||
this.cursor = tempRef_cursor.get();
|
||||
Reference<RowCursor> tempReference_cursor =
|
||||
new Reference<RowCursor>(this.cursor);
|
||||
value.set(this.row.ReadSparseUInt8(tempReference_cursor));
|
||||
this.cursor = tempReference_cursor.get();
|
||||
return Result.Success;
|
||||
default:
|
||||
value.set(0);
|
||||
@@ -970,12 +972,12 @@ public final class RowReader {
|
||||
}
|
||||
|
||||
/**
|
||||
* Read the current field as a fixed length <see cref="UnixDateTime" /> value.
|
||||
* Read the current field as a fixed length {@link UnixDateTime} value.
|
||||
*
|
||||
* @param value On success, receives the value, undefined otherwise.
|
||||
* @return Success if the read is successful, an error code otherwise.
|
||||
*/
|
||||
public Result ReadUnixDateTime(OutObject<UnixDateTime> value) {
|
||||
public Result ReadUnixDateTime(Out<UnixDateTime> value) {
|
||||
switch (this.state) {
|
||||
case Schematized:
|
||||
return this.ReadPrimitiveValue(value.clone());
|
||||
@@ -985,10 +987,10 @@ public final class RowReader {
|
||||
return Result.TypeMismatch;
|
||||
}
|
||||
|
||||
RefObject<RowCursor> tempRef_cursor =
|
||||
new RefObject<RowCursor>(this.cursor);
|
||||
value.set(this.row.ReadSparseUnixDateTime(tempRef_cursor).clone());
|
||||
this.cursor = tempRef_cursor.get();
|
||||
Reference<RowCursor> tempReference_cursor =
|
||||
new Reference<RowCursor>(this.cursor);
|
||||
value.set(this.row.ReadSparseUnixDateTime(tempReference_cursor).clone());
|
||||
this.cursor = tempReference_cursor.get();
|
||||
return Result.Success;
|
||||
default:
|
||||
value.set(null);
|
||||
@@ -1002,7 +1004,7 @@ public final class RowReader {
|
||||
* @param value On success, receives the value, undefined otherwise.
|
||||
* @return Success if the read is successful, an error code otherwise.
|
||||
*/
|
||||
public Result ReadVarInt(OutObject<Long> value) {
|
||||
public Result ReadVarInt(Out<Long> value) {
|
||||
switch (this.state) {
|
||||
case Schematized:
|
||||
return this.ReadPrimitiveValue(value);
|
||||
@@ -1012,10 +1014,10 @@ public final class RowReader {
|
||||
return Result.TypeMismatch;
|
||||
}
|
||||
|
||||
RefObject<RowCursor> tempRef_cursor =
|
||||
new RefObject<RowCursor>(this.cursor);
|
||||
value.set(this.row.ReadSparseVarInt(tempRef_cursor));
|
||||
this.cursor = tempRef_cursor.get();
|
||||
Reference<RowCursor> tempReference_cursor =
|
||||
new Reference<RowCursor>(this.cursor);
|
||||
value.set(this.row.ReadSparseVarInt(tempReference_cursor));
|
||||
this.cursor = tempReference_cursor.get();
|
||||
return Result.Success;
|
||||
default:
|
||||
value.set(0);
|
||||
@@ -1031,7 +1033,7 @@ public final class RowReader {
|
||||
*/
|
||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||
//ORIGINAL LINE: public Result ReadVarUInt(out ulong value)
|
||||
public Result ReadVarUInt(OutObject<Long> value) {
|
||||
public Result ReadVarUInt(Out<Long> value) {
|
||||
switch (this.state) {
|
||||
case Schematized:
|
||||
return this.ReadPrimitiveValue(value);
|
||||
@@ -1041,10 +1043,10 @@ public final class RowReader {
|
||||
return Result.TypeMismatch;
|
||||
}
|
||||
|
||||
RefObject<RowCursor> tempRef_cursor =
|
||||
new RefObject<RowCursor>(this.cursor);
|
||||
value.set(this.row.ReadSparseVarUInt(tempRef_cursor));
|
||||
this.cursor = tempRef_cursor.get();
|
||||
Reference<RowCursor> tempReference_cursor =
|
||||
new Reference<RowCursor>(this.cursor);
|
||||
value.set(this.row.ReadSparseVarUInt(tempReference_cursor));
|
||||
this.cursor = tempReference_cursor.get();
|
||||
return Result.Success;
|
||||
default:
|
||||
value.set(0);
|
||||
@@ -1062,22 +1064,22 @@ public final class RowReader {
|
||||
* <p>
|
||||
* <p>
|
||||
* The reader must not have been advanced since the child reader was created with ReadScope.
|
||||
* This method can be used when the overload of <see cref="ReadScope" /> that takes a
|
||||
* <see cref="ReaderFunc{TContext}" /> is not an option, such as when TContext is a ref struct.
|
||||
* This method can be used when the overload of {@link ReadScope} that takes a
|
||||
* {@link ReaderFunc{TContext}} is not an option, such as when TContext is a ref struct.
|
||||
*/
|
||||
public Result SkipScope(RefObject<RowReader> nestedReader) {
|
||||
public Result SkipScope(Reference<RowReader> nestedReader) {
|
||||
if (nestedReader.get().cursor.start != this.cursor.valueOffset) {
|
||||
return Result.Failure;
|
||||
}
|
||||
|
||||
RefObject<RowBuffer> tempRef_row =
|
||||
new RefObject<RowBuffer>(this.row);
|
||||
RefObject<RowCursor> tempRef_cursor =
|
||||
new RefObject<RowCursor>(nestedReader.get().cursor);
|
||||
RowCursorExtensions.Skip(this.cursor.clone(), tempRef_row,
|
||||
tempRef_cursor);
|
||||
nestedReader.get().argValue.cursor = tempRef_cursor.get();
|
||||
this.row = tempRef_row.get();
|
||||
Reference<RowBuffer> tempReference_row =
|
||||
new Reference<RowBuffer>(this.row);
|
||||
Reference<RowCursor> tempReference_cursor =
|
||||
new Reference<RowCursor>(nestedReader.get().cursor);
|
||||
RowCursorExtensions.Skip(this.cursor.clone(), tempReference_row,
|
||||
tempReference_cursor);
|
||||
nestedReader.get().argValue.cursor = tempReference_cursor.get();
|
||||
this.row = tempReference_row.get();
|
||||
return Result.Success;
|
||||
}
|
||||
|
||||
@@ -1101,7 +1103,7 @@ public final class RowReader {
|
||||
* @param value On success, receives the value, undefined otherwise.
|
||||
* @return Success if the read is successful, an error code otherwise.
|
||||
*/
|
||||
private <TValue> Result ReadPrimitiveValue(OutObject<TValue> value) {
|
||||
private <TValue> Result ReadPrimitiveValue(Out<TValue> value) {
|
||||
LayoutColumn col = this.columns[this.columnIndex];
|
||||
LayoutType t = this.columns[this.columnIndex].Type;
|
||||
if (!(t instanceof LayoutType<TValue>)) {
|
||||
@@ -1111,20 +1113,20 @@ public final class RowReader {
|
||||
|
||||
switch (col == null ? null : col.getStorage()) {
|
||||
case Fixed:
|
||||
RefObject<RowBuffer> tempRef_row =
|
||||
new RefObject<RowBuffer>(this.row);
|
||||
RefObject<RowCursor> tempRef_cursor =
|
||||
new RefObject<RowCursor>(this.cursor);
|
||||
Result tempVar = t.<LayoutType<TValue>>TypeAs().ReadFixed(tempRef_row, tempRef_cursor, col, value);
|
||||
this.cursor = tempRef_cursor.get();
|
||||
this.row = tempRef_row.get();
|
||||
Reference<RowBuffer> tempReference_row =
|
||||
new Reference<RowBuffer>(this.row);
|
||||
Reference<RowCursor> tempReference_cursor =
|
||||
new Reference<RowCursor>(this.cursor);
|
||||
Result tempVar = t.<LayoutType<TValue>>TypeAs().ReadFixed(tempReference_row, tempReference_cursor, col, value);
|
||||
this.cursor = tempReference_cursor.get();
|
||||
this.row = tempReference_row.get();
|
||||
return tempVar;
|
||||
case Variable:
|
||||
RefObject<RowBuffer> tempRef_row2 = new RefObject<RowBuffer>(this.row);
|
||||
RefObject<RowCursor> tempRef_cursor2 = new RefObject<RowCursor>(this.cursor);
|
||||
Result tempVar2 = t.<LayoutType<TValue>>TypeAs().ReadVariable(tempRef_row2, tempRef_cursor2, col, value);
|
||||
this.cursor = tempRef_cursor2.get();
|
||||
this.row = tempRef_row2.get();
|
||||
Reference<RowBuffer> tempReference_row2 = new Reference<RowBuffer>(this.row);
|
||||
Reference<RowCursor> tempReference_cursor2 = new Reference<RowCursor>(this.cursor);
|
||||
Result tempVar2 = t.<LayoutType<TValue>>TypeAs().ReadVariable(tempReference_row2, tempReference_cursor2, col, value);
|
||||
this.cursor = tempReference_cursor2.get();
|
||||
this.row = tempReference_row2.get();
|
||||
return tempVar2;
|
||||
default:
|
||||
throw new IllegalStateException();
|
||||
@@ -1139,7 +1141,7 @@ public final class RowReader {
|
||||
* @param value On success, receives the value, undefined otherwise.
|
||||
* @return Success if the read is successful, an error code otherwise.
|
||||
*/
|
||||
private Result ReadPrimitiveValue(OutObject<Utf8Span> value) {
|
||||
private Result ReadPrimitiveValue(Out<Utf8Span> value) {
|
||||
LayoutColumn col = this.columns[this.columnIndex];
|
||||
LayoutType t = this.columns[this.columnIndex].Type;
|
||||
if (!(t instanceof ILayoutUtf8SpanReadable)) {
|
||||
@@ -1149,18 +1151,19 @@ public final class RowReader {
|
||||
|
||||
switch (col == null ? null : col.getStorage()) {
|
||||
case Fixed:
|
||||
RefObject<RowBuffer> tempRef_row = new RefObject<RowBuffer>(this.row);
|
||||
RefObject<RowCursor> tempRef_cursor = new RefObject<RowCursor>(this.cursor);
|
||||
Result tempVar = t.<ILayoutUtf8SpanReadable>TypeAs().ReadFixed(tempRef_row, tempRef_cursor, col, value);
|
||||
this.cursor = tempRef_cursor.get();
|
||||
this.row = tempRef_row.get();
|
||||
Reference<RowBuffer> tempReference_row = new Reference<RowBuffer>(this.row);
|
||||
Reference<RowCursor> tempReference_cursor = new Reference<RowCursor>(this.cursor);
|
||||
Result tempVar = t.<ILayoutUtf8SpanReadable>TypeAs().ReadFixed(tempReference_row, tempReference_cursor, col, value);
|
||||
this.cursor = tempReference_cursor.get();
|
||||
this.row = tempReference_row.get();
|
||||
return tempVar;
|
||||
case Variable:
|
||||
RefObject<RowBuffer> tempRef_row2 = new RefObject<RowBuffer>(this.row);
|
||||
RefObject<RowCursor> tempRef_cursor2 = new RefObject<RowCursor>(this.cursor);
|
||||
Result tempVar2 = t.<ILayoutUtf8SpanReadable>TypeAs().ReadVariable(tempRef_row2, tempRef_cursor2, col, value);
|
||||
this.cursor = tempRef_cursor2.get();
|
||||
this.row = tempRef_row2.get();
|
||||
Reference<RowBuffer> tempReference_row2 = new Reference<RowBuffer>(this.row);
|
||||
Reference<RowCursor> tempReference_cursor2 = new Reference<RowCursor>(this.cursor);
|
||||
Result tempVar2 = t.<ILayoutUtf8SpanReadable>TypeAs().ReadVariable(tempReference_row2,
|
||||
tempReference_cursor2, col, value);
|
||||
this.cursor = tempReference_cursor2.get();
|
||||
this.row = tempReference_row2.get();
|
||||
return tempVar2;
|
||||
default:
|
||||
throw new IllegalStateException();
|
||||
@@ -1176,7 +1179,7 @@ public final class RowReader {
|
||||
* @param value On success, receives the value, undefined otherwise.
|
||||
* @return Success if the read is successful, an error code otherwise.
|
||||
*/
|
||||
private <TElement> Result ReadPrimitiveValue(OutObject<ReadOnlySpan<TElement>> value) {
|
||||
private <TElement> Result ReadPrimitiveValue(Out<ReadOnlySpan<TElement>> value) {
|
||||
LayoutColumn col = this.columns[this.columnIndex];
|
||||
LayoutType t = this.columns[this.columnIndex].Type;
|
||||
if (!(t instanceof ILayoutSpanReadable<TElement>)) {
|
||||
@@ -1186,18 +1189,18 @@ public final class RowReader {
|
||||
|
||||
switch (col == null ? null : col.getStorage()) {
|
||||
case Fixed:
|
||||
RefObject<RowBuffer> tempRef_row = new RefObject<RowBuffer>(this.row);
|
||||
RefObject<RowCursor> tempRef_cursor = new RefObject<RowCursor>(this.cursor);
|
||||
Result tempVar = t.<ILayoutSpanReadable<TElement>>TypeAs().ReadFixed(tempRef_row, tempRef_cursor, col, value);
|
||||
this.cursor = tempRef_cursor.get();
|
||||
this.row = tempRef_row.get();
|
||||
Reference<RowBuffer> tempReference_row = new Reference<RowBuffer>(this.row);
|
||||
Reference<RowCursor> tempReference_cursor = new Reference<RowCursor>(this.cursor);
|
||||
Result tempVar = t.<ILayoutSpanReadable<TElement>>TypeAs().ReadFixed(tempReference_row, tempReference_cursor, col, value);
|
||||
this.cursor = tempReference_cursor.get();
|
||||
this.row = tempReference_row.get();
|
||||
return tempVar;
|
||||
case Variable:
|
||||
RefObject<RowBuffer> tempRef_row2 = new RefObject<RowBuffer>(this.row);
|
||||
RefObject<RowCursor> tempRef_cursor2 = new RefObject<RowCursor>(this.cursor);
|
||||
Result tempVar2 = t.<ILayoutSpanReadable<TElement>>TypeAs().ReadVariable(tempRef_row2, tempRef_cursor2, col, value);
|
||||
this.cursor = tempRef_cursor2.get();
|
||||
this.row = tempRef_row2.get();
|
||||
Reference<RowBuffer> tempReference_row2 = new Reference<RowBuffer>(this.row);
|
||||
Reference<RowCursor> tempReference_cursor2 = new Reference<RowCursor>(this.cursor);
|
||||
Result tempVar2 = t.<ILayoutSpanReadable<TElement>>TypeAs().ReadVariable(tempReference_row2, tempReference_cursor2, col, value);
|
||||
this.cursor = tempReference_cursor2.get();
|
||||
this.row = tempReference_row2.get();
|
||||
return tempVar2;
|
||||
default:
|
||||
throw new IllegalStateException();
|
||||
@@ -1244,7 +1247,7 @@ public final class RowReader {
|
||||
}
|
||||
|
||||
/**
|
||||
* A function to reader content from a <see cref="RowBuffer" />.
|
||||
* A function to reader content from a {@link RowBuffer}.
|
||||
* <typeparam name="TContext">The type of the context value passed by the caller.</typeparam>
|
||||
*
|
||||
* @param reader A forward-only cursor for writing content.
|
||||
@@ -1253,12 +1256,12 @@ public final class RowReader {
|
||||
*/
|
||||
@FunctionalInterface
|
||||
public interface ReaderFunc<TContext> {
|
||||
Result invoke(RefObject<RowReader> reader, TContext context);
|
||||
Result invoke(Reference<RowReader> reader, TContext context);
|
||||
}
|
||||
|
||||
/**
|
||||
* An encapsulation of the current state of a <see cref="RowReader" /> that can be used to
|
||||
* recreate the <see cref="RowReader" /> in the same logical position.
|
||||
* An encapsulation of the current state of a {@link RowReader} that can be used to
|
||||
* recreate the {@link RowReader} in the same logical position.
|
||||
*/
|
||||
//C# TO JAVA CONVERTER WARNING: Java does not allow user-defined value types. The behavior of this class may differ from the original:
|
||||
//ORIGINAL LINE: public readonly struct Checkpoint
|
||||
|
||||
@@ -4,8 +4,9 @@
|
||||
|
||||
package com.azure.data.cosmos.serialization.hybridrow.io;
|
||||
|
||||
import com.azure.data.cosmos.core.OutObject;
|
||||
import com.azure.data.cosmos.core.RefObject;
|
||||
import com.azure.data.cosmos.core.Out;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.Result;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -21,13 +22,13 @@ public final class RowReaderExtensions {
|
||||
* @param list On success, the collection of materialized items.
|
||||
* @return The result.
|
||||
*/
|
||||
public static <TItem> Result ReadList(RefObject<RowReader> reader, DeserializerFunc<TItem> deserializer,
|
||||
OutObject<ArrayList<TItem>> list) {
|
||||
public static <TItem> Result ReadList(Reference<RowReader> reader, DeserializerFunc<TItem> deserializer,
|
||||
Out<ArrayList<TItem>> list) {
|
||||
// Pass the context as a struct by value to avoid allocations.
|
||||
ListContext<TItem> ctx = new ListContext<TItem>();
|
||||
ctx.List = new ArrayList<>();
|
||||
ctx.Deserializer =
|
||||
(RefObject<RowReader> reader.argValue, OutObject<TItem> item) -> deserializer.invoke(reader.get().clone(), item);
|
||||
(Reference<RowReader> reader.argValue, Out<TItem> item) -> deserializer.invoke(reader.get().clone(), item);
|
||||
|
||||
// All lambda's here are static.
|
||||
// TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not
|
||||
@@ -37,12 +38,12 @@ public final class RowReaderExtensions {
|
||||
while (arrayReader.Read()) {
|
||||
Result r2 = arrayReader.ReadScope(ctx1.clone(), (ref RowReader itemReader, ListContext<TItem> ctx2) ->
|
||||
{
|
||||
RefObject<com.azure.data.cosmos.serialization.hybridrow.io.RowReader> tempRef_itemReader = new RefObject<com.azure.data.cosmos.serialization.hybridrow.io.RowReader>(itemReader);
|
||||
Reference<com.azure.data.cosmos.serialization.hybridrow.io.RowReader> tempReference_itemReader = new Reference<com.azure.data.cosmos.serialization.hybridrow.io.RowReader>(itemReader);
|
||||
TItem op;
|
||||
OutObject<TItem> tempOut_op = new OutObject<TItem>();
|
||||
Result r3 = ctx2.Deserializer.invoke(tempRef_itemReader, tempOut_op);
|
||||
Out<TItem> tempOut_op = new Out<TItem>();
|
||||
Result r3 = ctx2.Deserializer.invoke(tempReference_itemReader, tempOut_op);
|
||||
op = tempOut_op.get();
|
||||
itemReader = tempRef_itemReader.get();
|
||||
itemReader = tempReference_itemReader.get();
|
||||
if (r3 != Result.Success) {
|
||||
return r3;
|
||||
}
|
||||
@@ -69,7 +70,7 @@ public final class RowReaderExtensions {
|
||||
}
|
||||
|
||||
/**
|
||||
* A function to read content from a <see cref="RowReader" />.
|
||||
* A function to read content from a {@link RowReader}.
|
||||
* <typeparam name="TItem">The type of the item to read.</typeparam>
|
||||
*
|
||||
* @param reader A forward-only cursor for reading the item.
|
||||
@@ -78,7 +79,7 @@ public final class RowReaderExtensions {
|
||||
*/
|
||||
@FunctionalInterface
|
||||
public interface DeserializerFunc<TItem> {
|
||||
Result invoke(RefObject<RowReader> reader, OutObject<TItem> item);
|
||||
Result invoke(Reference<RowReader> reader, Out<TItem> item);
|
||||
}
|
||||
|
||||
//C# TO JAVA CONVERTER WARNING: Java does not allow user-defined value types. The behavior of this class may
|
||||
|
||||
@@ -4,8 +4,9 @@
|
||||
|
||||
package com.azure.data.cosmos.serialization.hybridrow.io;
|
||||
|
||||
import com.azure.data.cosmos.core.OutObject;
|
||||
import com.azure.data.cosmos.core.RefObject;
|
||||
import com.azure.data.cosmos.core.Out;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.Float128;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.NullValue;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.Result;
|
||||
@@ -33,19 +34,19 @@ public final class RowWriter {
|
||||
private RowBuffer row = new RowBuffer();
|
||||
|
||||
/**
|
||||
* Initializes a new instance of the <see cref="RowWriter" /> struct.
|
||||
* Initializes a new instance of the {@link RowWriter} struct.
|
||||
*
|
||||
* @param row The row to be read.
|
||||
* @param scope The scope into which items should be written.
|
||||
* <p>
|
||||
* A <see cref="RowWriter" /> instance writes the fields of a given scope from left to right
|
||||
* A {@link RowWriter} instance writes the fields of a given scope from left to right
|
||||
* in a forward only manner. If the root scope is provided then all top-level fields in the row can be
|
||||
* written.
|
||||
*/
|
||||
public RowWriter() {
|
||||
}
|
||||
|
||||
private RowWriter(RefObject<RowBuffer> row, RefObject<RowCursor> scope) {
|
||||
private RowWriter(Reference<RowBuffer> row, Reference<RowCursor> scope) {
|
||||
this.row = row.get().clone();
|
||||
this.cursor = scope.get().clone();
|
||||
}
|
||||
@@ -84,7 +85,7 @@ public final class RowWriter {
|
||||
// TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not
|
||||
// converted by C# to Java Converter:
|
||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
|
||||
// cannot be converted using the 'RefObject' helper class unless the method is within the code being modified:
|
||||
// cannot be converted using the 'Ref' helper class unless the method is within the code being modified:
|
||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||
//ORIGINAL LINE: return this.WritePrimitive(path, value, LayoutType.Binary, (ref RowWriter w, byte[] v) => w
|
||||
// .row.WriteSparseBinary(ref w.cursor, v, UpdateOptions.Upsert));
|
||||
@@ -105,7 +106,7 @@ public final class RowWriter {
|
||||
// TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not
|
||||
// converted by C# to Java Converter:
|
||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
|
||||
// cannot be converted using the 'RefObject' helper class unless the method is within the code being modified:
|
||||
// cannot be converted using the 'Ref' helper class unless the method is within the code being modified:
|
||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||
//ORIGINAL LINE: return this.WritePrimitive(path, value, LayoutType.Binary, (ref RowWriter w,
|
||||
// ReadOnlySpan<byte> v) => w.row.WriteSparseBinary(ref w.cursor, v, UpdateOptions.Upsert));
|
||||
@@ -126,7 +127,7 @@ public final class RowWriter {
|
||||
// TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not
|
||||
// converted by C# to Java Converter:
|
||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
|
||||
// cannot be converted using the 'RefObject' helper class unless the method is within the code being modified:
|
||||
// cannot be converted using the 'Ref' helper class unless the method is within the code being modified:
|
||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||
//ORIGINAL LINE: return this.WritePrimitive(path, value, LayoutType.Binary, (ref RowWriter w,
|
||||
// ReadOnlySequence<byte> v) => w.row.WriteSparseBinary(ref w.cursor, v, UpdateOptions.Upsert));
|
||||
@@ -136,7 +137,7 @@ public final class RowWriter {
|
||||
}
|
||||
|
||||
/**
|
||||
* Write a field as a <see cref="bool" />.
|
||||
* Write a field as a {@link bool}.
|
||||
*
|
||||
* @param path The scope-relative path of the field to write.
|
||||
* @param value The value to write.
|
||||
@@ -146,7 +147,7 @@ public final class RowWriter {
|
||||
// TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not
|
||||
// converted by C# to Java Converter:
|
||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
|
||||
// cannot be converted using the 'RefObject' helper class unless the method is within the code being modified:
|
||||
// cannot be converted using the 'Ref' helper class unless the method is within the code being modified:
|
||||
return this.WritePrimitive(path, value, LayoutType.Boolean,
|
||||
(ref RowWriter w, boolean v) -> w.row.WriteSparseBool(ref w.cursor, v, UpdateOptions.Upsert));
|
||||
}
|
||||
@@ -160,26 +161,26 @@ public final class RowWriter {
|
||||
* @param func A function to write the entire row.
|
||||
* @return Success if the write is successful, an error code otherwise.
|
||||
*/
|
||||
public static <TContext> Result WriteBuffer(RefObject<RowBuffer> row, TContext context,
|
||||
public static <TContext> Result WriteBuffer(Reference<RowBuffer> row, TContext context,
|
||||
WriterFunc<TContext> func) {
|
||||
RowCursor scope = RowCursor.Create(row);
|
||||
RefObject<RowCursor> tempRef_scope =
|
||||
new RefObject<RowCursor>(scope);
|
||||
RowWriter writer = new RowWriter(row, tempRef_scope);
|
||||
scope = tempRef_scope.get();
|
||||
Reference<RowCursor> tempReference_scope =
|
||||
new Reference<RowCursor>(scope);
|
||||
RowWriter writer = new RowWriter(row, tempReference_scope);
|
||||
scope = tempReference_scope.get();
|
||||
TypeArgument typeArg = new TypeArgument(LayoutType.UDT,
|
||||
new TypeArgumentList(scope.layout.getSchemaId().clone()));
|
||||
RefObject<RowWriter> tempRef_writer =
|
||||
new RefObject<RowWriter>(writer);
|
||||
Reference<RowWriter> tempReference_writer =
|
||||
new Reference<RowWriter>(writer);
|
||||
// TODO: C# TO JAVA CONVERTER: The following line could not be converted:
|
||||
Result result = func(ref writer, typeArg, context);
|
||||
writer = tempRef_writer.get();
|
||||
writer = tempReference_writer.get();
|
||||
row.set(writer.row.clone());
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Write a field as a fixed length <see cref="DateTime" /> value.
|
||||
* Write a field as a fixed length {@link DateTime} value.
|
||||
*
|
||||
* @param path The scope-relative path of the field to write.
|
||||
* @param value The value to write.
|
||||
@@ -189,13 +190,13 @@ public final class RowWriter {
|
||||
// TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not
|
||||
// converted by C# to Java Converter:
|
||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
|
||||
// cannot be converted using the 'RefObject' helper class unless the method is within the code being modified:
|
||||
// cannot be converted using the 'Ref' helper class unless the method is within the code being modified:
|
||||
return this.WritePrimitive(path, value, LayoutType.DateTime,
|
||||
(ref RowWriter w, LocalDateTime v) -> w.row.WriteSparseDateTime(ref w.cursor, v, UpdateOptions.Upsert));
|
||||
}
|
||||
|
||||
/**
|
||||
* Write a field as a fixed length <see cref="decimal" /> value.
|
||||
* Write a field as a fixed length {@link decimal} value.
|
||||
*
|
||||
* @param path The scope-relative path of the field to write.
|
||||
* @param value The value to write.
|
||||
@@ -205,7 +206,7 @@ public final class RowWriter {
|
||||
// TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not
|
||||
// converted by C# to Java Converter:
|
||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
|
||||
// cannot be converted using the 'RefObject' helper class unless the method is within the code being modified:
|
||||
// cannot be converted using the 'Ref' helper class unless the method is within the code being modified:
|
||||
return this.WritePrimitive(path, value, LayoutType.Decimal,
|
||||
(ref RowWriter w, BigDecimal v) -> w.row.WriteSparseDecimal(ref w.cursor, v, UpdateOptions.Upsert));
|
||||
}
|
||||
@@ -221,7 +222,7 @@ public final class RowWriter {
|
||||
// TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not
|
||||
// converted by C# to Java Converter:
|
||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
|
||||
// cannot be converted using the 'RefObject' helper class unless the method is within the code being modified:
|
||||
// cannot be converted using the 'Ref' helper class unless the method is within the code being modified:
|
||||
return this.WritePrimitive(path, value.clone(), LayoutType.Float128,
|
||||
(ref RowWriter w, Float128 v) -> w.row.WriteSparseFloat128(ref w.cursor, v.clone(), UpdateOptions.Upsert));
|
||||
}
|
||||
@@ -237,7 +238,7 @@ public final class RowWriter {
|
||||
// TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not
|
||||
// converted by C# to Java Converter:
|
||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
|
||||
// cannot be converted using the 'RefObject' helper class unless the method is within the code being modified:
|
||||
// cannot be converted using the 'Ref' helper class unless the method is within the code being modified:
|
||||
return this.WritePrimitive(path, value, LayoutType.Float32,
|
||||
(ref RowWriter w, float v) -> w.row.WriteSparseFloat32(ref w.cursor, v, UpdateOptions.Upsert));
|
||||
}
|
||||
@@ -253,13 +254,13 @@ public final class RowWriter {
|
||||
// TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not
|
||||
// converted by C# to Java Converter:
|
||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
|
||||
// cannot be converted using the 'RefObject' helper class unless the method is within the code being modified:
|
||||
// cannot be converted using the 'Ref' helper class unless the method is within the code being modified:
|
||||
return this.WritePrimitive(path, value, LayoutType.Float64,
|
||||
(ref RowWriter w, double v) -> w.row.WriteSparseFloat64(ref w.cursor, v, UpdateOptions.Upsert));
|
||||
}
|
||||
|
||||
/**
|
||||
* Write a field as a fixed length <see cref="Guid" /> value.
|
||||
* Write a field as a fixed length {@link Guid} value.
|
||||
*
|
||||
* @param path The scope-relative path of the field to write.
|
||||
* @param value The value to write.
|
||||
@@ -269,7 +270,7 @@ public final class RowWriter {
|
||||
// TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not
|
||||
// converted by C# to Java Converter:
|
||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
|
||||
// cannot be converted using the 'RefObject' helper class unless the method is within the code being modified:
|
||||
// cannot be converted using the 'Ref' helper class unless the method is within the code being modified:
|
||||
return this.WritePrimitive(path, value, LayoutType.Guid,
|
||||
(ref RowWriter w, UUID v) -> w.row.WriteSparseGuid(ref w.cursor, v, UpdateOptions.Upsert));
|
||||
}
|
||||
@@ -285,7 +286,7 @@ public final class RowWriter {
|
||||
// TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not
|
||||
// converted by C# to Java Converter:
|
||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
|
||||
// cannot be converted using the 'RefObject' helper class unless the method is within the code being modified:
|
||||
// cannot be converted using the 'Ref' helper class unless the method is within the code being modified:
|
||||
return this.WritePrimitive(path, value, LayoutType.Int16,
|
||||
(ref RowWriter w, short v) -> w.row.WriteSparseInt16(ref w.cursor, v, UpdateOptions.Upsert));
|
||||
}
|
||||
@@ -301,7 +302,7 @@ public final class RowWriter {
|
||||
// TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not
|
||||
// converted by C# to Java Converter:
|
||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
|
||||
// cannot be converted using the 'RefObject' helper class unless the method is within the code being modified:
|
||||
// cannot be converted using the 'Ref' helper class unless the method is within the code being modified:
|
||||
return this.WritePrimitive(path, value, LayoutType.Int32,
|
||||
(ref RowWriter w, int v) -> w.row.WriteSparseInt32(ref w.cursor, v, UpdateOptions.Upsert));
|
||||
}
|
||||
@@ -317,7 +318,7 @@ public final class RowWriter {
|
||||
// TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not
|
||||
// converted by C# to Java Converter:
|
||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
|
||||
// cannot be converted using the 'RefObject' helper class unless the method is within the code being modified:
|
||||
// cannot be converted using the 'Ref' helper class unless the method is within the code being modified:
|
||||
return this.WritePrimitive(path, value, LayoutType.Int64,
|
||||
(ref RowWriter w, long v) -> w.row.WriteSparseInt64(ref w.cursor, v, UpdateOptions.Upsert));
|
||||
}
|
||||
@@ -333,13 +334,13 @@ public final class RowWriter {
|
||||
// TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not
|
||||
// converted by C# to Java Converter:
|
||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
|
||||
// cannot be converted using the 'RefObject' helper class unless the method is within the code being modified:
|
||||
// cannot be converted using the 'Ref' helper class unless the method is within the code being modified:
|
||||
return this.WritePrimitive(path, value, LayoutType.Int8,
|
||||
(ref RowWriter w, byte v) -> w.row.WriteSparseInt8(ref w.cursor, v, UpdateOptions.Upsert));
|
||||
}
|
||||
|
||||
/**
|
||||
* Write a field as a fixed length <see cref="MongoDbObjectId" /> value.
|
||||
* Write a field as a fixed length {@link MongoDbObjectId} value.
|
||||
*
|
||||
* @param path The scope-relative path of the field to write.
|
||||
* @param value The value to write.
|
||||
@@ -349,13 +350,13 @@ public final class RowWriter {
|
||||
// TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not
|
||||
// converted by C# to Java Converter:
|
||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
|
||||
// cannot be converted using the 'RefObject' helper class unless the method is within the code being modified:
|
||||
// cannot be converted using the 'Ref' helper class unless the method is within the code being modified:
|
||||
return this.WritePrimitive(path, value.clone(), LayoutType.MongoDbObjectId, (ref RowWriter w,
|
||||
MongoDbObjectId v) -> w.row.WriteSparseMongoDbObjectId(ref w.cursor, v.clone(), UpdateOptions.Upsert));
|
||||
}
|
||||
|
||||
/**
|
||||
* Write a field as a <see cref="t:null"/>.
|
||||
* Write a field as a {@link t:null}.
|
||||
*
|
||||
* @param path The scope-relative path of the field to write.
|
||||
* @return Success if the write is successful, an error code otherwise.
|
||||
@@ -364,7 +365,7 @@ public final class RowWriter {
|
||||
// TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not
|
||||
// converted by C# to Java Converter:
|
||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
|
||||
// cannot be converted using the 'RefObject' helper class unless the method is within the code being modified:
|
||||
// cannot be converted using the 'Ref' helper class unless the method is within the code being modified:
|
||||
return this.WritePrimitive(path, NullValue.Default, LayoutType.Null,
|
||||
(ref RowWriter w, NullValue v) -> w.row.WriteSparseNull(ref w.cursor, v.clone(), UpdateOptions.Upsert));
|
||||
}
|
||||
@@ -383,10 +384,10 @@ public final class RowWriter {
|
||||
//ORIGINAL LINE: case LayoutObject scopeType:
|
||||
case LayoutObject
|
||||
scopeType:
|
||||
RefObject<RowCursor> tempRef_cursor =
|
||||
new RefObject<RowCursor>(this.cursor);
|
||||
OutObject<RowCursor> tempOut_nestedScope =
|
||||
new OutObject<RowCursor>();
|
||||
Reference<RowCursor> tempReference_cursor =
|
||||
new Reference<RowCursor>(this.cursor);
|
||||
Out<RowCursor> tempOut_nestedScope =
|
||||
new Out<RowCursor>();
|
||||
this.row.WriteSparseObject(tempRef_cursor, scopeType, UpdateOptions.Upsert, tempOut_nestedScope);
|
||||
nestedScope = tempOut_nestedScope.get();
|
||||
this.cursor = tempRef_cursor.argValue;
|
||||
@@ -395,10 +396,10 @@ public final class RowWriter {
|
||||
//ORIGINAL LINE: case LayoutArray scopeType:
|
||||
case LayoutArray
|
||||
scopeType:
|
||||
RefObject<RowCursor> tempRef_cursor2 =
|
||||
new RefObject<RowCursor>(this.cursor);
|
||||
OutObject<RowCursor> tempOut_nestedScope2 =
|
||||
new OutObject<RowCursor>();
|
||||
Reference<RowCursor> tempReference_cursor2 =
|
||||
new Reference<RowCursor>(this.cursor);
|
||||
Out<RowCursor> tempOut_nestedScope2 =
|
||||
new Out<RowCursor>();
|
||||
this.row.WriteSparseArray(tempRef_cursor2, scopeType, UpdateOptions.Upsert, tempOut_nestedScope2);
|
||||
nestedScope = tempOut_nestedScope2.get();
|
||||
this.cursor = tempRef_cursor2.argValue;
|
||||
@@ -407,10 +408,10 @@ public final class RowWriter {
|
||||
//ORIGINAL LINE: case LayoutTypedArray scopeType:
|
||||
case LayoutTypedArray
|
||||
scopeType:
|
||||
RefObject<RowCursor> tempRef_cursor3 =
|
||||
new RefObject<RowCursor>(this.cursor);
|
||||
OutObject<RowCursor> tempOut_nestedScope3 =
|
||||
new OutObject<RowCursor>();
|
||||
Reference<RowCursor> tempReference_cursor3 =
|
||||
new Reference<RowCursor>(this.cursor);
|
||||
Out<RowCursor> tempOut_nestedScope3 =
|
||||
new Out<RowCursor>();
|
||||
this.row.WriteTypedArray(tempRef_cursor3, scopeType, typeArg.getTypeArgs().clone(),
|
||||
UpdateOptions.Upsert, tempOut_nestedScope3);
|
||||
nestedScope = tempOut_nestedScope3.get();
|
||||
@@ -421,10 +422,10 @@ public final class RowWriter {
|
||||
//ORIGINAL LINE: case LayoutTuple scopeType:
|
||||
case LayoutTuple
|
||||
scopeType:
|
||||
RefObject<RowCursor> tempRef_cursor4 =
|
||||
new RefObject<RowCursor>(this.cursor);
|
||||
OutObject<RowCursor> tempOut_nestedScope4 =
|
||||
new OutObject<RowCursor>();
|
||||
Reference<RowCursor> tempReference_cursor4 =
|
||||
new Reference<RowCursor>(this.cursor);
|
||||
Out<RowCursor> tempOut_nestedScope4 =
|
||||
new Out<RowCursor>();
|
||||
this.row.WriteSparseTuple(tempRef_cursor4, scopeType, typeArg.getTypeArgs().clone(),
|
||||
UpdateOptions.Upsert, tempOut_nestedScope4);
|
||||
nestedScope = tempOut_nestedScope4.get();
|
||||
@@ -435,10 +436,10 @@ public final class RowWriter {
|
||||
//ORIGINAL LINE: case LayoutTypedTuple scopeType:
|
||||
case LayoutTypedTuple
|
||||
scopeType:
|
||||
RefObject<RowCursor> tempRef_cursor5 =
|
||||
new RefObject<RowCursor>(this.cursor);
|
||||
OutObject<RowCursor> tempOut_nestedScope5 =
|
||||
new OutObject<RowCursor>();
|
||||
Reference<RowCursor> tempReference_cursor5 =
|
||||
new Reference<RowCursor>(this.cursor);
|
||||
Out<RowCursor> tempOut_nestedScope5 =
|
||||
new Out<RowCursor>();
|
||||
this.row.WriteTypedTuple(tempRef_cursor5, scopeType, typeArg.getTypeArgs().clone(),
|
||||
UpdateOptions.Upsert, tempOut_nestedScope5);
|
||||
nestedScope = tempOut_nestedScope5.get();
|
||||
@@ -449,10 +450,10 @@ public final class RowWriter {
|
||||
//ORIGINAL LINE: case LayoutTagged scopeType:
|
||||
case LayoutTagged
|
||||
scopeType:
|
||||
RefObject<RowCursor> tempRef_cursor6 =
|
||||
new RefObject<RowCursor>(this.cursor);
|
||||
OutObject<RowCursor> tempOut_nestedScope6 =
|
||||
new OutObject<RowCursor>();
|
||||
Reference<RowCursor> tempReference_cursor6 =
|
||||
new Reference<RowCursor>(this.cursor);
|
||||
Out<RowCursor> tempOut_nestedScope6 =
|
||||
new Out<RowCursor>();
|
||||
this.row.WriteTypedTuple(tempRef_cursor6, scopeType, typeArg.getTypeArgs().clone(),
|
||||
UpdateOptions.Upsert, tempOut_nestedScope6);
|
||||
nestedScope = tempOut_nestedScope6.get();
|
||||
@@ -463,10 +464,10 @@ public final class RowWriter {
|
||||
//ORIGINAL LINE: case LayoutTagged2 scopeType:
|
||||
case LayoutTagged2
|
||||
scopeType:
|
||||
RefObject<RowCursor> tempRef_cursor7 =
|
||||
new RefObject<RowCursor>(this.cursor);
|
||||
OutObject<RowCursor> tempOut_nestedScope7 =
|
||||
new OutObject<RowCursor>();
|
||||
Reference<RowCursor> tempReference_cursor7 =
|
||||
new Reference<RowCursor>(this.cursor);
|
||||
Out<RowCursor> tempOut_nestedScope7 =
|
||||
new Out<RowCursor>();
|
||||
this.row.WriteTypedTuple(tempRef_cursor7, scopeType, typeArg.getTypeArgs().clone(),
|
||||
UpdateOptions.Upsert, tempOut_nestedScope7);
|
||||
nestedScope = tempOut_nestedScope7.get();
|
||||
@@ -477,10 +478,10 @@ public final class RowWriter {
|
||||
//ORIGINAL LINE: case LayoutNullable scopeType:
|
||||
case LayoutNullable
|
||||
scopeType:
|
||||
RefObject<RowCursor> tempRef_cursor8 =
|
||||
new RefObject<RowCursor>(this.cursor);
|
||||
OutObject<RowCursor> tempOut_nestedScope8 =
|
||||
new OutObject<RowCursor>();
|
||||
Reference<RowCursor> tempReference_cursor8 =
|
||||
new Reference<RowCursor>(this.cursor);
|
||||
Out<RowCursor> tempOut_nestedScope8 =
|
||||
new Out<RowCursor>();
|
||||
this.row.WriteNullable(tempRef_cursor8, scopeType, typeArg.getTypeArgs().clone(),
|
||||
UpdateOptions.Upsert, func != null, tempOut_nestedScope8);
|
||||
nestedScope = tempOut_nestedScope8.get();
|
||||
@@ -492,23 +493,23 @@ public final class RowWriter {
|
||||
case LayoutUDT
|
||||
scopeType:
|
||||
Layout udt = this.row.getResolver().Resolve(typeArg.getTypeArgs().getSchemaId().clone());
|
||||
RefObject<RowCursor> tempRef_cursor9 =
|
||||
new RefObject<RowCursor>(this.cursor);
|
||||
OutObject<RowCursor> tempOut_nestedScope9 =
|
||||
new OutObject<RowCursor>();
|
||||
this.row.WriteSparseUDT(tempRef_cursor9, scopeType, udt, UpdateOptions.Upsert, tempOut_nestedScope9);
|
||||
Reference<RowCursor> tempReference_cursor9 =
|
||||
new Reference<RowCursor>(this.cursor);
|
||||
Out<RowCursor> tempOut_nestedScope9 =
|
||||
new Out<RowCursor>();
|
||||
this.row.WriteSparseUDT(tempReference_cursor9, scopeType, udt, UpdateOptions.Upsert, tempOut_nestedScope9);
|
||||
nestedScope = tempOut_nestedScope9.get();
|
||||
this.cursor = tempRef_cursor9.get();
|
||||
this.cursor = tempReference_cursor9.get();
|
||||
break;
|
||||
|
||||
// TODO: C# TO JAVA CONVERTER: Java has no equivalent to C# pattern variables in 'case' statements:
|
||||
//ORIGINAL LINE: case LayoutTypedSet scopeType:
|
||||
case LayoutTypedSet
|
||||
scopeType:
|
||||
RefObject<RowCursor> tempRef_cursor10 =
|
||||
new RefObject<RowCursor>(this.cursor);
|
||||
OutObject<RowCursor> tempOut_nestedScope10 =
|
||||
new OutObject<RowCursor>();
|
||||
Reference<RowCursor> tempReference_cursor10 =
|
||||
new Reference<RowCursor>(this.cursor);
|
||||
Out<RowCursor> tempOut_nestedScope10 =
|
||||
new Out<RowCursor>();
|
||||
this.row.WriteTypedSet(tempRef_cursor10, scopeType, typeArg.getTypeArgs().clone(),
|
||||
UpdateOptions.Upsert, tempOut_nestedScope10);
|
||||
nestedScope = tempOut_nestedScope10.get();
|
||||
@@ -519,10 +520,10 @@ public final class RowWriter {
|
||||
//ORIGINAL LINE: case LayoutTypedMap scopeType:
|
||||
case LayoutTypedMap
|
||||
scopeType:
|
||||
RefObject<RowCursor> tempRef_cursor11 =
|
||||
new RefObject<RowCursor>(this.cursor);
|
||||
OutObject<RowCursor> tempOut_nestedScope11 =
|
||||
new OutObject<RowCursor>();
|
||||
Reference<RowCursor> tempReference_cursor11 =
|
||||
new Reference<RowCursor>(this.cursor);
|
||||
Out<RowCursor> tempOut_nestedScope11 =
|
||||
new Out<RowCursor>();
|
||||
this.row.WriteTypedMap(tempRef_cursor11, scopeType, typeArg.getTypeArgs().clone(),
|
||||
UpdateOptions.Upsert, tempOut_nestedScope11);
|
||||
nestedScope = tempOut_nestedScope11.get();
|
||||
@@ -534,18 +535,18 @@ public final class RowWriter {
|
||||
return Result.Failure;
|
||||
}
|
||||
|
||||
RefObject<RowBuffer> tempRef_row =
|
||||
new RefObject<RowBuffer>(this.row);
|
||||
RefObject<RowCursor> tempRef_nestedScope =
|
||||
new RefObject<RowCursor>(nestedScope);
|
||||
RowWriter nestedWriter = new RowWriter(tempRef_row, tempRef_nestedScope);
|
||||
nestedScope = tempRef_nestedScope.get();
|
||||
this.row = tempRef_row.get();
|
||||
RefObject<RowWriter> tempRef_nestedWriter =
|
||||
new RefObject<RowWriter>(nestedWriter);
|
||||
Reference<RowBuffer> tempReference_row =
|
||||
new Reference<RowBuffer>(this.row);
|
||||
Reference<RowCursor> tempReference_nestedScope =
|
||||
new Reference<RowCursor>(nestedScope);
|
||||
RowWriter nestedWriter = new RowWriter(tempReference_row, tempReference_nestedScope);
|
||||
nestedScope = tempReference_nestedScope.get();
|
||||
this.row = tempReference_row.get();
|
||||
Reference<RowWriter> tempReference_nestedWriter =
|
||||
new Reference<RowWriter>(nestedWriter);
|
||||
// TODO: C# TO JAVA CONVERTER: The following line could not be converted:
|
||||
result = func == null ? null : func.Invoke(ref nestedWriter, typeArg, context) ??Result.Success;
|
||||
nestedWriter = tempRef_nestedWriter.get();
|
||||
nestedWriter = tempReference_nestedWriter.get();
|
||||
this.row = nestedWriter.row.clone();
|
||||
nestedScope.count = nestedWriter.cursor.count;
|
||||
|
||||
@@ -555,24 +556,24 @@ public final class RowWriter {
|
||||
}
|
||||
|
||||
if (type instanceof LayoutUniqueScope) {
|
||||
RefObject<RowCursor> tempRef_nestedScope2 =
|
||||
new RefObject<RowCursor>(nestedScope);
|
||||
result = this.row.TypedCollectionUniqueIndexRebuild(tempRef_nestedScope2);
|
||||
nestedScope = tempRef_nestedScope2.get();
|
||||
Reference<RowCursor> tempReference_nestedScope2 =
|
||||
new Reference<RowCursor>(nestedScope);
|
||||
result = this.row.TypedCollectionUniqueIndexRebuild(tempReference_nestedScope2);
|
||||
nestedScope = tempReference_nestedScope2.get();
|
||||
if (result != Result.Success) {
|
||||
// TODO: If the index rebuild fails then the row is corrupted. Should we automatically clean up here?
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
RefObject<RowBuffer> tempRef_row2 =
|
||||
new RefObject<RowBuffer>(this.row);
|
||||
RefObject<RowCursor> tempRef_cursor12 =
|
||||
new RefObject<RowCursor>(nestedWriter.cursor);
|
||||
RowCursorExtensions.MoveNext(this.cursor.clone(), tempRef_row2
|
||||
, tempRef_cursor12);
|
||||
nestedWriter.cursor = tempRef_cursor12.get();
|
||||
this.row = tempRef_row2.get();
|
||||
Reference<RowBuffer> tempReference_row2 =
|
||||
new Reference<RowBuffer>(this.row);
|
||||
Reference<RowCursor> tempReference_cursor12 =
|
||||
new Reference<RowCursor>(nestedWriter.cursor);
|
||||
RowCursorExtensions.MoveNext(this.cursor.clone(), tempReference_row2
|
||||
, tempReference_cursor12);
|
||||
nestedWriter.cursor = tempReference_cursor12.get();
|
||||
this.row = tempReference_row2.get();
|
||||
return Result.Success;
|
||||
}
|
||||
|
||||
@@ -587,7 +588,7 @@ public final class RowWriter {
|
||||
// TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not
|
||||
// converted by C# to Java Converter:
|
||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
|
||||
// cannot be converted using the 'RefObject' helper class unless the method is within the code being modified:
|
||||
// cannot be converted using the 'Ref' helper class unless the method is within the code being modified:
|
||||
return this.WritePrimitive(path, value, LayoutType.Utf8,
|
||||
(ref RowWriter w, String v) -> w.row.WriteSparseString(ref w.cursor, Utf8Span.TranscodeUtf16(v),
|
||||
UpdateOptions.Upsert));
|
||||
@@ -604,7 +605,7 @@ public final class RowWriter {
|
||||
// TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not
|
||||
// converted by C# to Java Converter:
|
||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
|
||||
// cannot be converted using the 'RefObject' helper class unless the method is within the code being modified:
|
||||
// cannot be converted using the 'Ref' helper class unless the method is within the code being modified:
|
||||
return this.WritePrimitive(path, value, LayoutType.Utf8,
|
||||
(ref RowWriter w, Utf8Span v) -> w.row.WriteSparseString(ref w.cursor, v, UpdateOptions.Upsert));
|
||||
}
|
||||
@@ -622,7 +623,7 @@ public final class RowWriter {
|
||||
// TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not
|
||||
// converted by C# to Java Converter:
|
||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
|
||||
// cannot be converted using the 'RefObject' helper class unless the method is within the code being modified:
|
||||
// cannot be converted using the 'Ref' helper class unless the method is within the code being modified:
|
||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||
//ORIGINAL LINE: return this.WritePrimitive(path, value, LayoutType.UInt16, (ref RowWriter w, ushort v) => w
|
||||
// .row.WriteSparseUInt16(ref w.cursor, v, UpdateOptions.Upsert));
|
||||
@@ -643,7 +644,7 @@ public final class RowWriter {
|
||||
// TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not
|
||||
// converted by C# to Java Converter:
|
||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
|
||||
// cannot be converted using the 'RefObject' helper class unless the method is within the code being modified:
|
||||
// cannot be converted using the 'Ref' helper class unless the method is within the code being modified:
|
||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||
//ORIGINAL LINE: return this.WritePrimitive(path, value, LayoutType.UInt32, (ref RowWriter w, uint v) => w
|
||||
// .row.WriteSparseUInt32(ref w.cursor, v, UpdateOptions.Upsert));
|
||||
@@ -664,7 +665,7 @@ public final class RowWriter {
|
||||
// TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not
|
||||
// converted by C# to Java Converter:
|
||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
|
||||
// cannot be converted using the 'RefObject' helper class unless the method is within the code being modified:
|
||||
// cannot be converted using the 'Ref' helper class unless the method is within the code being modified:
|
||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||
//ORIGINAL LINE: return this.WritePrimitive(path, value, LayoutType.UInt64, (ref RowWriter w, ulong v) => w
|
||||
// .row.WriteSparseUInt64(ref w.cursor, v, UpdateOptions.Upsert));
|
||||
@@ -685,7 +686,7 @@ public final class RowWriter {
|
||||
// TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not
|
||||
// converted by C# to Java Converter:
|
||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
|
||||
// cannot be converted using the 'RefObject' helper class unless the method is within the code being modified:
|
||||
// cannot be converted using the 'Ref' helper class unless the method is within the code being modified:
|
||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||
//ORIGINAL LINE: return this.WritePrimitive(path, value, LayoutType.UInt8, (ref RowWriter w, byte v) => w.row
|
||||
// .WriteSparseUInt8(ref w.cursor, v, UpdateOptions.Upsert));
|
||||
@@ -694,7 +695,7 @@ public final class RowWriter {
|
||||
}
|
||||
|
||||
/**
|
||||
* Write a field as a fixed length <see cref="UnixDateTime" /> value.
|
||||
* Write a field as a fixed length {@link UnixDateTime} value.
|
||||
*
|
||||
* @param path The scope-relative path of the field to write.
|
||||
* @param value The value to write.
|
||||
@@ -704,7 +705,7 @@ public final class RowWriter {
|
||||
// TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not
|
||||
// converted by C# to Java Converter:
|
||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
|
||||
// cannot be converted using the 'RefObject' helper class unless the method is within the code being modified:
|
||||
// cannot be converted using the 'Ref' helper class unless the method is within the code being modified:
|
||||
return this.WritePrimitive(path, value.clone(), LayoutType.UnixDateTime,
|
||||
(ref RowWriter w, UnixDateTime v) -> w.row.WriteSparseUnixDateTime(ref w.cursor, v.clone(),
|
||||
UpdateOptions.Upsert));
|
||||
@@ -721,7 +722,7 @@ public final class RowWriter {
|
||||
// TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not
|
||||
// converted by C# to Java Converter:
|
||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
|
||||
// cannot be converted using the 'RefObject' helper class unless the method is within the code being modified:
|
||||
// cannot be converted using the 'Ref' helper class unless the method is within the code being modified:
|
||||
return this.WritePrimitive(path, value, LayoutType.VarInt,
|
||||
(ref RowWriter w, long v) -> w.row.WriteSparseVarInt(ref w.cursor, v, UpdateOptions.Upsert));
|
||||
}
|
||||
@@ -739,7 +740,7 @@ public final class RowWriter {
|
||||
// TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not
|
||||
// converted by C# to Java Converter:
|
||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
|
||||
// cannot be converted using the 'RefObject' helper class unless the method is within the code being modified:
|
||||
// cannot be converted using the 'Ref' helper class unless the method is within the code being modified:
|
||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||
//ORIGINAL LINE: return this.WritePrimitive(path, value, LayoutType.VarUInt, (ref RowWriter w, ulong v) => w
|
||||
// .row.WriteSparseVarUInt(ref w.cursor, v, UpdateOptions.Upsert));
|
||||
@@ -769,13 +770,13 @@ public final class RowWriter {
|
||||
return Result.TypeConstraint;
|
||||
}
|
||||
} else if (this.cursor.scopeType instanceof LayoutTypedMap) {
|
||||
RefObject<RowCursor> tempRef_cursor =
|
||||
new RefObject<RowCursor>(this.cursor);
|
||||
if (!typeArg.equals(this.cursor.scopeType.<LayoutUniqueScope>TypeAs().FieldType(tempRef_cursor).clone())) {
|
||||
this.cursor = tempRef_cursor.get();
|
||||
Reference<RowCursor> tempReference_cursor =
|
||||
new Reference<RowCursor>(this.cursor);
|
||||
if (!typeArg.equals(this.cursor.scopeType.<LayoutUniqueScope>TypeAs().FieldType(tempReference_cursor).clone())) {
|
||||
this.cursor = tempReference_cursor.get();
|
||||
return Result.TypeConstraint;
|
||||
} else {
|
||||
this.cursor = tempRef_cursor.get();
|
||||
this.cursor = tempReference_cursor.get();
|
||||
}
|
||||
} else if (this.cursor.scopeType.IsTypedScope && !typeArg.equals(this.cursor.scopeTypeArgs.get(0).clone())) {
|
||||
return Result.TypeConstraint;
|
||||
@@ -792,7 +793,7 @@ public final class RowWriter {
|
||||
* @param path The scope-relative path of the field to write.
|
||||
* @param value The value to write.
|
||||
* @param type The layout type.
|
||||
* @param sparse The <see cref="RowBuffer" /> access method for <paramref name="type" />.
|
||||
* @param sparse The {@link RowBuffer} access method for <paramref name="type" />.
|
||||
* @return Success if the write is successful, an error code otherwise.
|
||||
*/
|
||||
private <TLayoutType extends LayoutType<String> & ILayoutUtf8SpanWritable> Result WritePrimitive(UtfAnyString path, Utf8Span value, TLayoutType type, AccessUtf8SpanMethod sparse) {
|
||||
@@ -808,16 +809,16 @@ public final class RowWriter {
|
||||
return result;
|
||||
}
|
||||
|
||||
RefObject<RowWriter> tempRef_this =
|
||||
new RefObject<RowWriter>(this);
|
||||
Reference<RowWriter> tempReference_this =
|
||||
new Reference<RowWriter>(this);
|
||||
// TODO: C# TO JAVA CONVERTER: The following line could not be converted:
|
||||
sparse(ref this, value)
|
||||
this = tempRef_this.get();
|
||||
RefObject<RowBuffer> tempRef_row =
|
||||
new RefObject<RowBuffer>(this.row);
|
||||
this = tempReference_this.get();
|
||||
Reference<RowBuffer> tempReference_row =
|
||||
new Reference<RowBuffer>(this.row);
|
||||
RowCursorExtensions.MoveNext(this.cursor.clone(),
|
||||
tempRef_row);
|
||||
this.row = tempRef_row.get();
|
||||
tempReference_row);
|
||||
this.row = tempReference_row.get();
|
||||
}
|
||||
|
||||
return result;
|
||||
@@ -831,7 +832,7 @@ public final class RowWriter {
|
||||
* @param path The scope-relative path of the field to write.
|
||||
* @param value The value to write.
|
||||
* @param type The layout type.
|
||||
* @param sparse The <see cref="RowBuffer" /> access method for <paramref name="type" />.
|
||||
* @param sparse The {@link RowBuffer} access method for <paramref name="type" />.
|
||||
* @return Success if the write is successful, an error code otherwise.
|
||||
*/
|
||||
private <TLayoutType extends LayoutType<TElement[]> & ILayoutSpanWritable<TElement>, TElement> Result WritePrimitive(UtfAnyString path, ReadOnlySpan<TElement> value, TLayoutType type, AccessReadOnlySpanMethod<TElement> sparse) {
|
||||
@@ -847,16 +848,16 @@ public final class RowWriter {
|
||||
return result;
|
||||
}
|
||||
|
||||
RefObject<RowWriter> tempRef_this =
|
||||
new RefObject<RowWriter>(this);
|
||||
Reference<RowWriter> tempReference_this =
|
||||
new Reference<RowWriter>(this);
|
||||
// TODO: C# TO JAVA CONVERTER: The following line could not be converted:
|
||||
sparse(ref this, value)
|
||||
this = tempRef_this.get();
|
||||
RefObject<RowBuffer> tempRef_row =
|
||||
new RefObject<RowBuffer>(this.row);
|
||||
this = tempReference_this.get();
|
||||
Reference<RowBuffer> tempReference_row =
|
||||
new Reference<RowBuffer>(this.row);
|
||||
RowCursorExtensions.MoveNext(this.cursor.clone(),
|
||||
tempRef_row);
|
||||
this.row = tempRef_row.get();
|
||||
tempReference_row);
|
||||
this.row = tempReference_row.get();
|
||||
}
|
||||
|
||||
return result;
|
||||
@@ -870,7 +871,7 @@ public final class RowWriter {
|
||||
* @param path The scope-relative path of the field to write.
|
||||
* @param value The value to write.
|
||||
* @param type The layout type.
|
||||
* @param sparse The <see cref="RowBuffer" /> access method for <paramref name="type" />.
|
||||
* @param sparse The {@link RowBuffer} access method for <paramref name="type" />.
|
||||
* @return Success if the write is successful, an error code otherwise.
|
||||
*/
|
||||
private <TLayoutType extends LayoutType<TElement[]> & ILayoutSequenceWritable<TElement>, TElement> Result WritePrimitive(UtfAnyString path, ReadOnlySequence<TElement> value, TLayoutType type, AccessMethod<ReadOnlySequence<TElement>> sparse) {
|
||||
@@ -886,16 +887,16 @@ public final class RowWriter {
|
||||
return result;
|
||||
}
|
||||
|
||||
RefObject<RowWriter> tempRef_this =
|
||||
new RefObject<RowWriter>(this);
|
||||
Reference<RowWriter> tempReference_this =
|
||||
new Reference<RowWriter>(this);
|
||||
// TODO: C# TO JAVA CONVERTER: The following line could not be converted:
|
||||
sparse(ref this, value)
|
||||
this = tempRef_this.get();
|
||||
RefObject<RowBuffer> tempRef_row =
|
||||
new RefObject<RowBuffer>(this.row);
|
||||
this = tempReference_this.get();
|
||||
Reference<RowBuffer> tempReference_row =
|
||||
new Reference<RowBuffer>(this.row);
|
||||
RowCursorExtensions.MoveNext(this.cursor.clone(),
|
||||
tempRef_row);
|
||||
this.row = tempRef_row.get();
|
||||
tempReference_row);
|
||||
this.row = tempReference_row.get();
|
||||
}
|
||||
|
||||
return result;
|
||||
@@ -908,7 +909,7 @@ public final class RowWriter {
|
||||
* @param path The scope-relative path of the field to write.
|
||||
* @param value The value to write.
|
||||
* @param type The layout type.
|
||||
* @param sparse The <see cref="RowBuffer" /> access method for <paramref name="type" />.
|
||||
* @param sparse The {@link RowBuffer} access method for <paramref name="type" />.
|
||||
* @return Success if the write is successful, an error code otherwise.
|
||||
*/
|
||||
private <TValue> Result WritePrimitive(UtfAnyString path, TValue value, LayoutType<TValue> type,
|
||||
@@ -926,16 +927,16 @@ public final class RowWriter {
|
||||
return result;
|
||||
}
|
||||
|
||||
RefObject<RowWriter> tempRef_this =
|
||||
new RefObject<RowWriter>(this);
|
||||
Reference<RowWriter> tempReference_this =
|
||||
new Reference<RowWriter>(this);
|
||||
// TODO: C# TO JAVA CONVERTER: The following line could not be converted:
|
||||
sparse(ref this, value)
|
||||
this = tempRef_this.get();
|
||||
RefObject<RowBuffer> tempRef_row =
|
||||
new RefObject<RowBuffer>(this.row);
|
||||
this = tempReference_this.get();
|
||||
Reference<RowBuffer> tempReference_row =
|
||||
new Reference<RowBuffer>(this.row);
|
||||
RowCursorExtensions.MoveNext(this.cursor.clone(),
|
||||
tempRef_row);
|
||||
this.row = tempRef_row.get();
|
||||
tempReference_row);
|
||||
this.row = tempReference_row.get();
|
||||
}
|
||||
|
||||
return result;
|
||||
@@ -952,7 +953,7 @@ public final class RowWriter {
|
||||
private <TValue> Result WriteSchematizedValue(UtfAnyString path, TValue value) {
|
||||
LayoutColumn col;
|
||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
|
||||
// cannot be converted using the 'OutObject' helper class unless the method is within the code being modified:
|
||||
// cannot be converted using the 'Out' helper class unless the method is within the code being modified:
|
||||
if (!this.cursor.layout.TryFind(path, out col)) {
|
||||
return Result.NotFound;
|
||||
}
|
||||
@@ -965,17 +966,17 @@ public final class RowWriter {
|
||||
|
||||
switch (col.Storage) {
|
||||
case StorageKind.Fixed:
|
||||
RefObject<RowBuffer> tempRef_row =
|
||||
new RefObject<RowBuffer>(this.row);
|
||||
Reference<RowBuffer> tempReference_row =
|
||||
new Reference<RowBuffer>(this.row);
|
||||
Result tempVar2 = t.WriteFixed(ref this.row, ref this.cursor, col, value)
|
||||
this.row = tempRef_row.get();
|
||||
this.row = tempReference_row.get();
|
||||
return tempVar2;
|
||||
|
||||
case StorageKind.Variable:
|
||||
RefObject<RowBuffer> tempRef_row2 =
|
||||
new RefObject<RowBuffer>(this.row);
|
||||
Reference<RowBuffer> tempReference_row2 =
|
||||
new Reference<RowBuffer>(this.row);
|
||||
Result tempVar3 = t.WriteVariable(ref this.row, ref this.cursor, col, value)
|
||||
this.row = tempRef_row2.get();
|
||||
this.row = tempReference_row2.get();
|
||||
return tempVar3;
|
||||
|
||||
default:
|
||||
@@ -995,7 +996,7 @@ public final class RowWriter {
|
||||
private Result WriteSchematizedValue(UtfAnyString path, Utf8Span value) {
|
||||
LayoutColumn col;
|
||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
|
||||
// cannot be converted using the 'OutObject' helper class unless the method is within the code being modified:
|
||||
// cannot be converted using the 'Out' helper class unless the method is within the code being modified:
|
||||
if (!this.cursor.layout.TryFind(path, out col)) {
|
||||
return Result.NotFound;
|
||||
}
|
||||
@@ -1007,24 +1008,25 @@ public final class RowWriter {
|
||||
|
||||
switch (col.Storage) {
|
||||
case StorageKind.Fixed:
|
||||
RefObject<RowBuffer> tempRef_row =
|
||||
new RefObject<RowBuffer>(this.row);
|
||||
RefObject<RowCursor> tempRef_cursor =
|
||||
new RefObject<RowCursor>(this.cursor);
|
||||
Result tempVar = t.<ILayoutUtf8SpanWritable>TypeAs().WriteFixed(tempRef_row, tempRef_cursor, col,
|
||||
Reference<RowBuffer> tempReference_row =
|
||||
new Reference<RowBuffer>(this.row);
|
||||
Reference<RowCursor> tempReference_cursor =
|
||||
new Reference<RowCursor>(this.cursor);
|
||||
Result tempVar = t.<ILayoutUtf8SpanWritable>TypeAs().WriteFixed(tempReference_row, tempReference_cursor, col,
|
||||
value);
|
||||
this.cursor = tempRef_cursor.get();
|
||||
this.row = tempRef_row.get();
|
||||
this.cursor = tempReference_cursor.get();
|
||||
this.row = tempReference_row.get();
|
||||
return tempVar;
|
||||
case StorageKind.Variable:
|
||||
RefObject<RowBuffer> tempRef_row2 =
|
||||
new RefObject<RowBuffer>(this.row);
|
||||
RefObject<RowCursor> tempRef_cursor2 =
|
||||
new RefObject<RowCursor>(this.cursor);
|
||||
Result tempVar2 = t.<ILayoutUtf8SpanWritable>TypeAs().WriteVariable(tempRef_row2, tempRef_cursor2,
|
||||
Reference<RowBuffer> tempReference_row2 =
|
||||
new Reference<RowBuffer>(this.row);
|
||||
Reference<RowCursor> tempReference_cursor2 =
|
||||
new Reference<RowCursor>(this.cursor);
|
||||
Result tempVar2 = t.<ILayoutUtf8SpanWritable>TypeAs().WriteVariable(tempReference_row2,
|
||||
tempReference_cursor2,
|
||||
col, value);
|
||||
this.cursor = tempRef_cursor2.get();
|
||||
this.row = tempRef_row2.get();
|
||||
this.cursor = tempReference_cursor2.get();
|
||||
this.row = tempReference_row2.get();
|
||||
return tempVar2;
|
||||
default:
|
||||
return Result.NotFound;
|
||||
@@ -1041,7 +1043,7 @@ public final class RowWriter {
|
||||
*/
|
||||
private <TElement> Result WriteSchematizedValue(UtfAnyString path, ReadOnlySpan<TElement> value) {
|
||||
LayoutColumn col;
|
||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot be converted using the 'OutObject' helper class unless the method is within the code being modified:
|
||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot be converted using the 'Out' helper class unless the method is within the code being modified:
|
||||
if (!this.cursor.layout.TryFind(path, out col)) {
|
||||
return Result.NotFound;
|
||||
}
|
||||
@@ -1053,18 +1055,18 @@ public final class RowWriter {
|
||||
|
||||
switch (col.Storage) {
|
||||
case StorageKind.Fixed:
|
||||
RefObject<RowBuffer> tempRef_row = new RefObject<RowBuffer>(this.row);
|
||||
RefObject<RowCursor> tempRef_cursor = new RefObject<RowCursor>(this.cursor);
|
||||
Result tempVar = t.<ILayoutSpanWritable<TElement>>TypeAs().WriteFixed(tempRef_row, tempRef_cursor, col, value);
|
||||
this.cursor = tempRef_cursor.get();
|
||||
this.row = tempRef_row.get();
|
||||
Reference<RowBuffer> tempReference_row = new Reference<RowBuffer>(this.row);
|
||||
Reference<RowCursor> tempReference_cursor = new Reference<RowCursor>(this.cursor);
|
||||
Result tempVar = t.<ILayoutSpanWritable<TElement>>TypeAs().WriteFixed(tempReference_row, tempReference_cursor, col, value);
|
||||
this.cursor = tempReference_cursor.get();
|
||||
this.row = tempReference_row.get();
|
||||
return tempVar;
|
||||
case StorageKind.Variable:
|
||||
RefObject<RowBuffer> tempRef_row2 = new RefObject<RowBuffer>(this.row);
|
||||
RefObject<RowCursor> tempRef_cursor2 = new RefObject<RowCursor>(this.cursor);
|
||||
Result tempVar2 = t.<ILayoutSpanWritable<TElement>>TypeAs().WriteVariable(tempRef_row2, tempRef_cursor2, col, value);
|
||||
this.cursor = tempRef_cursor2.get();
|
||||
this.row = tempRef_row2.get();
|
||||
Reference<RowBuffer> tempReference_row2 = new Reference<RowBuffer>(this.row);
|
||||
Reference<RowCursor> tempReference_cursor2 = new Reference<RowCursor>(this.cursor);
|
||||
Result tempVar2 = t.<ILayoutSpanWritable<TElement>>TypeAs().WriteVariable(tempReference_row2, tempReference_cursor2, col, value);
|
||||
this.cursor = tempReference_cursor2.get();
|
||||
this.row = tempReference_row2.get();
|
||||
return tempVar2;
|
||||
default:
|
||||
return Result.NotFound;
|
||||
@@ -1081,7 +1083,7 @@ public final class RowWriter {
|
||||
*/
|
||||
private <TElement> Result WriteSchematizedValue(UtfAnyString path, ReadOnlySequence<TElement> value) {
|
||||
LayoutColumn col;
|
||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot be converted using the 'OutObject' helper class unless the method is within the code being modified:
|
||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot be converted using the 'Out' helper class unless the method is within the code being modified:
|
||||
if (!this.cursor.layout.TryFind(path, out col)) {
|
||||
return Result.NotFound;
|
||||
}
|
||||
@@ -1093,18 +1095,18 @@ public final class RowWriter {
|
||||
|
||||
switch (col.Storage) {
|
||||
case StorageKind.Fixed:
|
||||
RefObject<RowBuffer> tempRef_row = new RefObject<RowBuffer>(this.row);
|
||||
RefObject<RowCursor> tempRef_cursor = new RefObject<RowCursor>(this.cursor);
|
||||
Result tempVar = t.<ILayoutSequenceWritable<TElement>>TypeAs().WriteFixed(tempRef_row, tempRef_cursor, col, value);
|
||||
this.cursor = tempRef_cursor.get();
|
||||
this.row = tempRef_row.get();
|
||||
Reference<RowBuffer> tempReference_row = new Reference<RowBuffer>(this.row);
|
||||
Reference<RowCursor> tempReference_cursor = new Reference<RowCursor>(this.cursor);
|
||||
Result tempVar = t.<ILayoutSequenceWritable<TElement>>TypeAs().WriteFixed(tempReference_row, tempReference_cursor, col, value);
|
||||
this.cursor = tempReference_cursor.get();
|
||||
this.row = tempReference_row.get();
|
||||
return tempVar;
|
||||
case StorageKind.Variable:
|
||||
RefObject<RowBuffer> tempRef_row2 = new RefObject<RowBuffer>(this.row);
|
||||
RefObject<RowCursor> tempRef_cursor2 = new RefObject<RowCursor>(this.cursor);
|
||||
Result tempVar2 = t.<ILayoutSequenceWritable<TElement>>TypeAs().WriteVariable(tempRef_row2, tempRef_cursor2, col, value);
|
||||
this.cursor = tempRef_cursor2.get();
|
||||
this.row = tempRef_row2.get();
|
||||
Reference<RowBuffer> tempReference_row2 = new Reference<RowBuffer>(this.row);
|
||||
Reference<RowCursor> tempReference_cursor2 = new Reference<RowCursor>(this.cursor);
|
||||
Result tempVar2 = t.<ILayoutSequenceWritable<TElement>>TypeAs().WriteVariable(tempReference_row2, tempReference_cursor2, col, value);
|
||||
this.cursor = tempReference_cursor2.get();
|
||||
this.row = tempReference_row2.get();
|
||||
return tempVar2;
|
||||
default:
|
||||
return Result.NotFound;
|
||||
@@ -1113,21 +1115,21 @@ public final class RowWriter {
|
||||
|
||||
@FunctionalInterface
|
||||
private interface AccessMethod<TValue> {
|
||||
void invoke(RefObject<RowWriter> writer, TValue value);
|
||||
void invoke(Reference<RowWriter> writer, TValue value);
|
||||
}
|
||||
|
||||
@FunctionalInterface
|
||||
private interface AccessReadOnlySpanMethod<T> {
|
||||
void invoke(RefObject<RowWriter> writer, ReadOnlySpan value);
|
||||
void invoke(Reference<RowWriter> writer, ReadOnlySpan value);
|
||||
}
|
||||
|
||||
@FunctionalInterface
|
||||
private interface AccessUtf8SpanMethod {
|
||||
void invoke(RefObject<RowWriter> writer, Utf8Span value);
|
||||
void invoke(Reference<RowWriter> writer, Utf8Span value);
|
||||
}
|
||||
|
||||
/**
|
||||
* A function to write content into a <see cref="RowBuffer" />.
|
||||
* A function to write content into a {@link RowBuffer}.
|
||||
* <typeparam name="TContext">The type of the context value passed by the caller.</typeparam>
|
||||
*
|
||||
* @param writer A forward-only cursor for writing content.
|
||||
@@ -1137,6 +1139,6 @@ public final class RowWriter {
|
||||
*/
|
||||
@FunctionalInterface
|
||||
public interface WriterFunc<TContext> {
|
||||
Result invoke(RefObject<RowWriter> writer, TypeArgument typeArg, TContext context);
|
||||
Result invoke(Reference<RowWriter> writer, TypeArgument typeArg, TContext context);
|
||||
}
|
||||
}
|
||||
@@ -4,8 +4,9 @@
|
||||
|
||||
package com.azure.data.cosmos.serialization.hybridrow.json;
|
||||
|
||||
import com.azure.data.cosmos.core.OutObject;
|
||||
import com.azure.data.cosmos.core.RefObject;
|
||||
import com.azure.data.cosmos.core.Out;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.Float128;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.NullValue;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.Result;
|
||||
@@ -16,26 +17,26 @@ import java.util.UUID;
|
||||
|
||||
public final class RowReaderJsonExtensions {
|
||||
/**
|
||||
* Project a JSON document from a HybridRow <see cref="RowReader"/>.
|
||||
* Project a JSON document from a HybridRow {@link RowReader}.
|
||||
*
|
||||
* @param reader The reader to project to JSON.
|
||||
* @param str If successful, the JSON document that corresponds to the <paramref name="reader"/>.
|
||||
* @return The result.
|
||||
*/
|
||||
public static Result ToJson(RefObject<RowReader> reader, OutObject<String> str) {
|
||||
public static Result ToJson(Reference<RowReader> reader, Out<String> str) {
|
||||
return RowReaderJsonExtensions.ToJson(reader.get().clone(), new RowReaderJsonSettings(" "), str);
|
||||
}
|
||||
|
||||
/**
|
||||
* Project a JSON document from a HybridRow <see cref="RowReader"/>.
|
||||
* Project a JSON document from a HybridRow {@link RowReader}.
|
||||
*
|
||||
* @param reader The reader to project to JSON.
|
||||
* @param settings Settings that control how the JSON document is formatted.
|
||||
* @param str If successful, the JSON document that corresponds to the <paramref name="reader"/>.
|
||||
* @return The result.
|
||||
*/
|
||||
public static Result ToJson(RefObject<RowReader> reader, RowReaderJsonSettings settings,
|
||||
OutObject<String> str) {
|
||||
public static Result ToJson(Reference<RowReader> reader, RowReaderJsonSettings settings,
|
||||
Out<String> str) {
|
||||
ReaderStringContext ctx = new ReaderStringContext(new StringBuilder(),
|
||||
new RowReaderJsonSettings(settings.IndentChars, settings.QuoteChar == '\'' ? '\'' : '"'), 1);
|
||||
|
||||
@@ -52,7 +53,7 @@ public final class RowReaderJsonExtensions {
|
||||
return Result.Success;
|
||||
}
|
||||
|
||||
private static Result ToJson(RefObject<RowReader> reader, ReaderStringContext ctx) {
|
||||
private static Result ToJson(Reference<RowReader> reader, ReaderStringContext ctx) {
|
||||
int index = 0;
|
||||
while (reader.get().Read()) {
|
||||
String path = !reader.get().getPath().IsNull ? String.format("%1$s%2$s%3$s:", ctx.Settings.QuoteChar,
|
||||
@@ -75,8 +76,8 @@ public final class RowReaderJsonExtensions {
|
||||
switch (reader.get().getType().LayoutCode) {
|
||||
case Null: {
|
||||
NullValue _;
|
||||
OutObject<NullValue> tempOut__ =
|
||||
new OutObject<NullValue>();
|
||||
Out<NullValue> tempOut__ =
|
||||
new Out<NullValue>();
|
||||
r = reader.get().ReadNull(tempOut__);
|
||||
_ = tempOut__.get();
|
||||
if (r != Result.Success) {
|
||||
@@ -89,7 +90,7 @@ public final class RowReaderJsonExtensions {
|
||||
|
||||
case Boolean: {
|
||||
boolean value;
|
||||
OutObject<Boolean> tempOut_value = new OutObject<Boolean>();
|
||||
Out<Boolean> tempOut_value = new Out<Boolean>();
|
||||
r = reader.get().ReadBool(tempOut_value);
|
||||
value = tempOut_value.get();
|
||||
if (r != Result.Success) {
|
||||
@@ -102,7 +103,7 @@ public final class RowReaderJsonExtensions {
|
||||
|
||||
case Int8: {
|
||||
byte value;
|
||||
OutObject<Byte> tempOut_value2 = new OutObject<Byte>();
|
||||
Out<Byte> tempOut_value2 = new Out<Byte>();
|
||||
r = reader.get().ReadInt8(tempOut_value2);
|
||||
value = tempOut_value2.get();
|
||||
if (r != Result.Success) {
|
||||
@@ -115,7 +116,7 @@ public final class RowReaderJsonExtensions {
|
||||
|
||||
case Int16: {
|
||||
short value;
|
||||
OutObject<Short> tempOut_value3 = new OutObject<Short>();
|
||||
Out<Short> tempOut_value3 = new Out<Short>();
|
||||
r = reader.get().ReadInt16(tempOut_value3);
|
||||
value = tempOut_value3.get();
|
||||
if (r != Result.Success) {
|
||||
@@ -128,7 +129,7 @@ public final class RowReaderJsonExtensions {
|
||||
|
||||
case Int32: {
|
||||
int value;
|
||||
OutObject<Integer> tempOut_value4 = new OutObject<Integer>();
|
||||
Out<Integer> tempOut_value4 = new Out<Integer>();
|
||||
r = reader.get().ReadInt32(tempOut_value4);
|
||||
value = tempOut_value4.get();
|
||||
if (r != Result.Success) {
|
||||
@@ -141,7 +142,7 @@ public final class RowReaderJsonExtensions {
|
||||
|
||||
case Int64: {
|
||||
long value;
|
||||
OutObject<Long> tempOut_value5 = new OutObject<Long>();
|
||||
Out<Long> tempOut_value5 = new Out<Long>();
|
||||
r = reader.get().ReadInt64(tempOut_value5);
|
||||
value = tempOut_value5.get();
|
||||
if (r != Result.Success) {
|
||||
@@ -154,7 +155,7 @@ public final class RowReaderJsonExtensions {
|
||||
|
||||
case UInt8: {
|
||||
byte value;
|
||||
OutObject<Byte> tempOut_value6 = new OutObject<Byte>();
|
||||
Out<Byte> tempOut_value6 = new Out<Byte>();
|
||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||
//ORIGINAL LINE: r = reader.ReadUInt8(out byte value);
|
||||
r = reader.get().ReadUInt8(tempOut_value6);
|
||||
@@ -169,7 +170,7 @@ public final class RowReaderJsonExtensions {
|
||||
|
||||
case UInt16: {
|
||||
short value;
|
||||
OutObject<Short> tempOut_value7 = new OutObject<Short>();
|
||||
Out<Short> tempOut_value7 = new Out<Short>();
|
||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||
//ORIGINAL LINE: r = reader.ReadUInt16(out ushort value);
|
||||
r = reader.get().ReadUInt16(tempOut_value7);
|
||||
@@ -184,7 +185,7 @@ public final class RowReaderJsonExtensions {
|
||||
|
||||
case UInt32: {
|
||||
int value;
|
||||
OutObject<Integer> tempOut_value8 = new OutObject<Integer>();
|
||||
Out<Integer> tempOut_value8 = new Out<Integer>();
|
||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||
//ORIGINAL LINE: r = reader.ReadUInt32(out uint value);
|
||||
r = reader.get().ReadUInt32(tempOut_value8);
|
||||
@@ -199,7 +200,7 @@ public final class RowReaderJsonExtensions {
|
||||
|
||||
case UInt64: {
|
||||
long value;
|
||||
OutObject<Long> tempOut_value9 = new OutObject<Long>();
|
||||
Out<Long> tempOut_value9 = new Out<Long>();
|
||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||
//ORIGINAL LINE: r = reader.ReadUInt64(out ulong value);
|
||||
r = reader.get().ReadUInt64(tempOut_value9);
|
||||
@@ -214,7 +215,7 @@ public final class RowReaderJsonExtensions {
|
||||
|
||||
case VarInt: {
|
||||
long value;
|
||||
OutObject<Long> tempOut_value10 = new OutObject<Long>();
|
||||
Out<Long> tempOut_value10 = new Out<Long>();
|
||||
r = reader.get().ReadVarInt(tempOut_value10);
|
||||
value = tempOut_value10.get();
|
||||
if (r != Result.Success) {
|
||||
@@ -227,7 +228,7 @@ public final class RowReaderJsonExtensions {
|
||||
|
||||
case VarUInt: {
|
||||
long value;
|
||||
OutObject<Long> tempOut_value11 = new OutObject<Long>();
|
||||
Out<Long> tempOut_value11 = new Out<Long>();
|
||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||
//ORIGINAL LINE: r = reader.ReadVarUInt(out ulong value);
|
||||
r = reader.get().ReadVarUInt(tempOut_value11);
|
||||
@@ -242,7 +243,7 @@ public final class RowReaderJsonExtensions {
|
||||
|
||||
case Float32: {
|
||||
float value;
|
||||
OutObject<Float> tempOut_value12 = new OutObject<Float>();
|
||||
Out<Float> tempOut_value12 = new Out<Float>();
|
||||
r = reader.get().ReadFloat32(tempOut_value12);
|
||||
value = tempOut_value12.get();
|
||||
if (r != Result.Success) {
|
||||
@@ -255,7 +256,7 @@ public final class RowReaderJsonExtensions {
|
||||
|
||||
case Float64: {
|
||||
double value;
|
||||
OutObject<Double> tempOut_value13 = new OutObject<Double>();
|
||||
Out<Double> tempOut_value13 = new Out<Double>();
|
||||
r = reader.get().ReadFloat64(tempOut_value13);
|
||||
value = tempOut_value13.get();
|
||||
if (r != Result.Success) {
|
||||
@@ -268,8 +269,8 @@ public final class RowReaderJsonExtensions {
|
||||
|
||||
case Float128: {
|
||||
Float128 _;
|
||||
OutObject<Float128> tempOut__2 =
|
||||
new OutObject<Float128>();
|
||||
Out<Float128> tempOut__2 =
|
||||
new Out<Float128>();
|
||||
r = reader.get().ReadFloat128(tempOut__2);
|
||||
_ = tempOut__2.get();
|
||||
if (r != Result.Success) {
|
||||
@@ -283,7 +284,7 @@ public final class RowReaderJsonExtensions {
|
||||
|
||||
case Decimal: {
|
||||
java.math.BigDecimal value;
|
||||
OutObject<BigDecimal> tempOut_value14 = new OutObject<BigDecimal>();
|
||||
Out<BigDecimal> tempOut_value14 = new Out<BigDecimal>();
|
||||
r = reader.get().ReadDecimal(tempOut_value14);
|
||||
value = tempOut_value14.get();
|
||||
if (r != Result.Success) {
|
||||
@@ -296,7 +297,7 @@ public final class RowReaderJsonExtensions {
|
||||
|
||||
case DateTime: {
|
||||
java.time.LocalDateTime value;
|
||||
OutObject<LocalDateTime> tempOut_value15 = new OutObject<LocalDateTime>();
|
||||
Out<LocalDateTime> tempOut_value15 = new Out<LocalDateTime>();
|
||||
r = reader.get().ReadDateTime(tempOut_value15);
|
||||
value = tempOut_value15.get();
|
||||
if (r != Result.Success) {
|
||||
@@ -311,8 +312,8 @@ public final class RowReaderJsonExtensions {
|
||||
|
||||
case UnixDateTime: {
|
||||
UnixDateTime value;
|
||||
OutObject<UnixDateTime> tempOut_value16 =
|
||||
new OutObject<UnixDateTime>();
|
||||
Out<UnixDateTime> tempOut_value16 =
|
||||
new Out<UnixDateTime>();
|
||||
r = reader.get().ReadUnixDateTime(tempOut_value16);
|
||||
value = tempOut_value16.get();
|
||||
if (r != Result.Success) {
|
||||
@@ -325,7 +326,7 @@ public final class RowReaderJsonExtensions {
|
||||
|
||||
case Guid: {
|
||||
java.util.UUID value;
|
||||
OutObject<UUID> tempOut_value17 = new OutObject<UUID>();
|
||||
Out<UUID> tempOut_value17 = new Out<UUID>();
|
||||
r = reader.get().ReadGuid(tempOut_value17);
|
||||
value = tempOut_value17.get();
|
||||
if (r != Result.Success) {
|
||||
@@ -340,7 +341,7 @@ public final class RowReaderJsonExtensions {
|
||||
|
||||
case MongoDbObjectId: {
|
||||
MongoDbObjectId value;
|
||||
OutObject<azure.data.cosmos.serialization.hybridrow.MongoDbObjectId> tempOut_value18 = new OutObject<azure.data.cosmos.serialization.hybridrow.MongoDbObjectId>();
|
||||
Out<azure.data.cosmos.serialization.hybridrow.MongoDbObjectId> tempOut_value18 = new Out<azure.data.cosmos.serialization.hybridrow.MongoDbObjectId>();
|
||||
r = reader.get().ReadMongoDbObjectId(tempOut_value18);
|
||||
value = tempOut_value18.get();
|
||||
if (r != Result.Success) {
|
||||
@@ -359,7 +360,7 @@ public final class RowReaderJsonExtensions {
|
||||
case Utf8: {
|
||||
Utf8Span value;
|
||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword
|
||||
// - these cannot be converted using the 'OutObject' helper class unless the method is within the
|
||||
// - these cannot be converted using the 'Out' helper class unless the method is within the
|
||||
// code being modified:
|
||||
r = reader.get().ReadString(out value);
|
||||
if (r != Result.Success) {
|
||||
@@ -374,7 +375,7 @@ public final class RowReaderJsonExtensions {
|
||||
|
||||
case Binary: {
|
||||
ReadOnlySpan<Byte> value;
|
||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot be converted using the 'OutObject' helper class unless the method is within the code being modified:
|
||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot be converted using the 'Out' helper class unless the method is within the code being modified:
|
||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||
//ORIGINAL LINE: r = reader.ReadBinary(out ReadOnlySpan<byte> value);
|
||||
r = reader.get().ReadBinary(out value);
|
||||
|
||||
@@ -20,7 +20,7 @@ public final class RowReaderJsonSettings {
|
||||
|
||||
/**
|
||||
* The quote character to use.
|
||||
* May be <see cref="lang:\""/> or <see cref="'" />.
|
||||
* May be <see cref="lang:\""/> or {@link '}.
|
||||
*/
|
||||
public char QuoteChar;
|
||||
|
||||
|
||||
@@ -4,30 +4,33 @@
|
||||
|
||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
||||
|
||||
import com.azure.data.cosmos.core.RefObject;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.Result;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
||||
|
||||
/**
|
||||
* An optional interface that indicates a <see cref="LayoutType{T}" /> can also write using a
|
||||
* <see cref="ReadOnlySequence{T}" />.
|
||||
* An optional interface that indicates a {@link LayoutType{T}} can also write using a {@link ReadOnlySequence{T}}.
|
||||
*
|
||||
* <typeparam name="TElement">The sub-element type to be written.</typeparam>
|
||||
*/
|
||||
public interface ILayoutSequenceWritable<TElement> extends ILayoutType {
|
||||
Result WriteFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
||||
ReadOnlySequence<TElement> value);
|
||||
|
||||
Result WriteSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
||||
ReadOnlySequence<TElement> value);
|
||||
Result WriteFixed(
|
||||
Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col, ReadOnlySequence<TElement> value);
|
||||
|
||||
//C# TO JAVA CONVERTER NOTE: Java does not support optional parameters. Overloaded method(s) are created above:
|
||||
//ORIGINAL LINE: Result WriteSparse(ref RowBuffer b, ref RowCursor edit, ReadOnlySequence<TElement> value,
|
||||
// UpdateOptions options = UpdateOptions.Upsert);
|
||||
Result WriteSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
||||
ReadOnlySequence<TElement> value, UpdateOptions options);
|
||||
Result WriteSparse(
|
||||
Reference<RowBuffer> b, Reference<RowCursor> edit, ReadOnlySequence<TElement> value);
|
||||
|
||||
Result WriteVariable(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
||||
ReadOnlySequence<TElement> value);
|
||||
// C# TO JAVA CONVERTER NOTE:
|
||||
// Java does not support optional parameters, hence overloaded method(s) are created
|
||||
// ORIGINAL LINE:
|
||||
// Result WriteSparse(ref RowBuffer b, ref RowCursor edit, ReadOnlySequence<TElement> value, UpdateOptions
|
||||
// options = UpdateOptions.Upsert);
|
||||
|
||||
Result WriteSparse(
|
||||
Reference<RowBuffer> b, Reference<RowCursor> edit, ReadOnlySequence<TElement> value, UpdateOptions options);
|
||||
|
||||
Result WriteVariable(
|
||||
Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col, ReadOnlySequence<TElement> value);
|
||||
}
|
||||
@@ -4,25 +4,24 @@
|
||||
|
||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
||||
|
||||
import com.azure.data.cosmos.core.OutObject;
|
||||
import com.azure.data.cosmos.core.RefObject;
|
||||
import com.azure.data.cosmos.core.Out;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.Result;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
||||
|
||||
/**
|
||||
* An optional interface that indicates a <see cref="LayoutType{T}" /> can also read using a
|
||||
* <see cref="ReadOnlySpan{T}" />.
|
||||
* An optional interface that indicates a {@link LayoutType{T}} can also read using a {@link ReadOnlySpan{T}}
|
||||
*
|
||||
* <typeparam name="TElement">The sub-element type to be written.</typeparam>
|
||||
*/
|
||||
public interface ILayoutSpanReadable<TElement> extends ILayoutType {
|
||||
Result ReadFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
||||
OutObject<ReadOnlySpan<TElement>> value);
|
||||
Result ReadFixed(
|
||||
Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col, Out<ReadOnlySpan<TElement>> value);
|
||||
|
||||
Result ReadSparse(RefObject<RowBuffer> b, RefObject<RowCursor> scope,
|
||||
OutObject<ReadOnlySpan<TElement>> value);
|
||||
Result ReadSparse(
|
||||
Reference<RowBuffer> b, Reference<RowCursor> scope, Out<ReadOnlySpan<TElement>> value);
|
||||
|
||||
Result ReadVariable(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
||||
OutObject<ReadOnlySpan<TElement>> value);
|
||||
Result ReadVariable(
|
||||
Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col, Out<ReadOnlySpan<TElement>> value);
|
||||
}
|
||||
@@ -4,30 +4,32 @@
|
||||
|
||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
||||
|
||||
import com.azure.data.cosmos.core.RefObject;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.Result;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
||||
|
||||
/**
|
||||
* An optional interface that indicates a <see cref="LayoutType{T}" /> can also write using a
|
||||
* <see cref="ReadOnlySpan{T}" />.
|
||||
* An optional interface that indicates a {@link LayoutType{T}} can also write using a
|
||||
* {@link ReadOnlySpan{T}}.
|
||||
*
|
||||
* <typeparam name="TElement">The sub-element type to be written.</typeparam>
|
||||
*/
|
||||
public interface ILayoutSpanWritable<TElement> extends ILayoutType {
|
||||
Result WriteFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
||||
ReadOnlySpan<TElement> value);
|
||||
|
||||
Result WriteSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
||||
ReadOnlySpan<TElement> value);
|
||||
Result WriteFixed(
|
||||
Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col, ReadOnlySpan<TElement> value);
|
||||
|
||||
//C# TO JAVA CONVERTER NOTE: Java does not support optional parameters. Overloaded method(s) are created above:
|
||||
//ORIGINAL LINE: Result WriteSparse(ref RowBuffer b, ref RowCursor edit, ReadOnlySpan<TElement> value,
|
||||
// UpdateOptions options = UpdateOptions.Upsert);
|
||||
Result WriteSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
||||
ReadOnlySpan<TElement> value, UpdateOptions options);
|
||||
Result WriteSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, ReadOnlySpan<TElement> value);
|
||||
|
||||
Result WriteVariable(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
||||
ReadOnlySpan<TElement> value);
|
||||
// C# TO JAVA CONVERTER NOTE:
|
||||
// Java does not support optional parameters, hence overloaded method(s) are created.
|
||||
// ORIGINAL LINE:
|
||||
// Result WriteSparse(ref RowBuffer b, ref RowCursor edit, ReadOnlySpan<TElement> value, UpdateOptions options = UpdateOptions.Upsert);
|
||||
|
||||
Result WriteSparse(
|
||||
Reference<RowBuffer> b, Reference<RowCursor> edit, ReadOnlySpan<TElement> value, UpdateOptions options);
|
||||
|
||||
Result WriteVariable(
|
||||
Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col, ReadOnlySpan<TElement> value);
|
||||
}
|
||||
@@ -4,22 +4,20 @@
|
||||
|
||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
||||
|
||||
import com.azure.data.cosmos.core.OutObject;
|
||||
import com.azure.data.cosmos.core.RefObject;
|
||||
import com.azure.data.cosmos.core.Out;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.Result;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
||||
|
||||
/**
|
||||
* An optional interface that indicates a <see cref="LayoutType{T}" /> can also read using a
|
||||
* <see cref="Utf8Span" />.
|
||||
* An optional interface that indicates a {@link LayoutType{T}} can also read using a {@link Utf8Span}.
|
||||
*/
|
||||
public interface ILayoutUtf8SpanReadable extends ILayoutType {
|
||||
Result ReadFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
||||
OutObject<Utf8Span> value);
|
||||
|
||||
Result ReadSparse(RefObject<RowBuffer> b, RefObject<RowCursor> scope, OutObject<Utf8Span> value);
|
||||
Result ReadFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col, Out<Utf8Span> value);
|
||||
|
||||
Result ReadVariable(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
||||
OutObject<Utf8Span> value);
|
||||
Result ReadSparse(Reference<RowBuffer> b, Reference<RowCursor> scope, Out<Utf8Span> value);
|
||||
|
||||
Result ReadVariable(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col, Out<Utf8Span> value);
|
||||
}
|
||||
@@ -4,26 +4,26 @@
|
||||
|
||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
||||
|
||||
import com.azure.data.cosmos.core.RefObject;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.Result;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
||||
|
||||
/**
|
||||
* An optional interface that indicates a <see cref="LayoutType{T}" /> can also write using a
|
||||
* <see cref="Utf8Span" />.
|
||||
* An optional interface that indicates a {@link LayoutType{T}} can also write using a {@link Utf8Span}.
|
||||
*/
|
||||
public interface ILayoutUtf8SpanWritable extends ILayoutType {
|
||||
Result WriteFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
||||
Utf8Span value);
|
||||
|
||||
Result WriteSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit, Utf8Span value);
|
||||
Result WriteFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col, Utf8Span value);
|
||||
|
||||
//C# TO JAVA CONVERTER NOTE: Java does not support optional parameters. Overloaded method(s) are created above:
|
||||
//ORIGINAL LINE: Result WriteSparse(ref RowBuffer b, ref RowCursor edit, Utf8Span value, UpdateOptions options =
|
||||
// UpdateOptions.Upsert);
|
||||
Result WriteSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit, Utf8Span value, UpdateOptions options);
|
||||
Result WriteSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, Utf8Span value);
|
||||
|
||||
Result WriteVariable(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
||||
Utf8Span value);
|
||||
// C# TO JAVA CONVERTER NOTE:
|
||||
// Java does not support optional parameters, hence overloaded method(s) are created.
|
||||
// ORIGINAL LINE:
|
||||
// Result WriteSparse(ref RowBuffer b, ref RowCursor edit, Utf8Span value, UpdateOptions options = UpdateOptions.Upsert);
|
||||
|
||||
Result WriteSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, Utf8Span value, UpdateOptions options);
|
||||
|
||||
Result WriteVariable(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col, Utf8Span value);
|
||||
}
|
||||
@@ -4,40 +4,44 @@
|
||||
|
||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
||||
|
||||
import com.azure.data.cosmos.core.OutObject;
|
||||
import com.azure.data.cosmos.core.Out;
|
||||
import com.azure.data.cosmos.core.Utf8String;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.SchemaId;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.schemas.Namespace;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.schemas.Schema;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.schemas.StorageKind;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
/**
|
||||
* A Layout describes the structure of a Hybrd Row.
|
||||
* A Layout describes the structure of a Hybrid Row
|
||||
* <p>
|
||||
* A layout indicates the number, order, and type of all schematized columns to be stored
|
||||
* within a hybrid row. The order and type of columns defines the physical ordering of bytes used to
|
||||
* encode the row and impacts the cost of updating the row.
|
||||
* <para />
|
||||
* A layout is created by compiling a <see cref="Schema" /> through <see cref="Schema.Compile" /> or
|
||||
* by constructor through a <see cref="LayoutBuilder" />.
|
||||
* <para />
|
||||
* <see cref="Layout" /> is immutable.
|
||||
* A layout indicates the number, order, and type of all schematized columns to be stored within a hybrid row. The
|
||||
* order and type of columns defines the physical ordering of bytes used to encode the row and impacts the cost of
|
||||
* updating the row.
|
||||
* <p>
|
||||
* A layout is created by compiling a {@link Schema} through {@link Schema#Compile(Namespace)} or by constructor through
|
||||
* a {@link LayoutBuilder}.
|
||||
*
|
||||
* {@link Layout} is immutable.
|
||||
*/
|
||||
public final class Layout {
|
||||
// TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes:
|
||||
//ORIGINAL LINE: [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes",
|
||||
// Justification = "Type is immutable.")] public static readonly Layout Empty = SystemSchema.LayoutResolver
|
||||
// .Resolve(SystemSchema.EmptySchemaId);
|
||||
|
||||
// TODO: C# TO JAVA CONVERTER:
|
||||
// Java annotations will not correspond to .NET attributes:
|
||||
// ORIGINAL LINE:
|
||||
// [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Type is immutable.")] public static readonly Layout Empty = SystemSchema.LayoutResolver.Resolve(SystemSchema.EmptySchemaId);
|
||||
|
||||
public static final Layout Empty = SystemSchema.LayoutResolver.Resolve(SystemSchema.EmptySchemaId);
|
||||
/**
|
||||
* Name of the layout.
|
||||
* <p>
|
||||
* Usually this is the name of the <see cref="Schema" /> from which this
|
||||
* <see cref="Layout" /> was generated.
|
||||
* Usually this is the name of the {@link Schema} from which this {@link Layout} was generated.
|
||||
*/
|
||||
private String Name;
|
||||
/**
|
||||
* The number of bitmask bytes allocated within the layout.
|
||||
* The number of bit mask bytes allocated within the layout.
|
||||
* <p>
|
||||
* A presence bit is allocated for each fixed and variable-length field. Sparse columns
|
||||
* never have presence bits. Fixed boolean allocate an additional bit from the bitmask to store their
|
||||
@@ -53,7 +57,7 @@ public final class Layout {
|
||||
*/
|
||||
private int NumVariable;
|
||||
/**
|
||||
* Unique identifier of the schema from which this <see cref="Layout" /> was generated.
|
||||
* Unique identifier of the schema from which this {@link Layout} was generated.
|
||||
*/
|
||||
private com.azure.data.cosmos.serialization.hybridrow.SchemaId SchemaId = new SchemaId();
|
||||
/**
|
||||
@@ -67,8 +71,7 @@ public final class Layout {
|
||||
private HashMap<String, LayoutColumn> pathStringMap;
|
||||
private LayoutColumn[] topColumns;
|
||||
|
||||
public Layout(String name, SchemaId schemaId, int numBitmaskBytes, int minRequiredSize,
|
||||
ArrayList<LayoutColumn> columns) {
|
||||
public Layout(String name, SchemaId schemaId, int numBitmaskBytes, int minRequiredSize, ArrayList<LayoutColumn> columns) {
|
||||
this.Name = name;
|
||||
this.SchemaId = schemaId.clone();
|
||||
this.NumBitmaskBytes = numBitmaskBytes;
|
||||
@@ -133,10 +136,11 @@ public final class Layout {
|
||||
* Finds a column specification for a column with a matching path.
|
||||
*
|
||||
* @param path The path of the column to find.
|
||||
* @param column If found, the column specification, otherwise null.
|
||||
* @return True if a column with the path is found, otherwise false.
|
||||
* @param column If found, the column specification, otherwise {@code null}.
|
||||
* @return {@code true} if a column with the path is found, otherwise {@code false}.
|
||||
*/
|
||||
public boolean TryFind(UtfAnyString path, OutObject<LayoutColumn> column) {
|
||||
public boolean TryFind(UtfAnyString path, Out<LayoutColumn> column) {
|
||||
|
||||
if (path.IsNull) {
|
||||
column.set(null);
|
||||
return false;
|
||||
@@ -156,12 +160,12 @@ public final class Layout {
|
||||
* @param column If found, the column specification, otherwise null.
|
||||
* @return True if a column with the path is found, otherwise false.
|
||||
*/
|
||||
public boolean TryFind(String path, OutObject<LayoutColumn> column) {
|
||||
public boolean TryFind(String path, Out<LayoutColumn> column) {
|
||||
return (this.pathStringMap.containsKey(path) && (column.set(this.pathStringMap.get(path))) == column.get());
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a human readable diagnostic string representation of this <see cref="Layout" />.
|
||||
* Returns a human readable diagnostic string representation of this {@link Layout}.
|
||||
* This representation should only be used for debugging and diagnostic purposes.
|
||||
*/
|
||||
@Override
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
|
||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
||||
|
||||
import com.azure.data.cosmos.core.OutObject;
|
||||
import com.azure.data.cosmos.core.RefObject;
|
||||
import com.azure.data.cosmos.core.Out;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.Result;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
||||
@@ -32,10 +32,10 @@ public final class LayoutArray extends LayoutIndexedScope {
|
||||
|
||||
@Override
|
||||
public Result WriteScope(
|
||||
RefObject<RowBuffer> b,
|
||||
RefObject<RowCursor> edit,
|
||||
Reference<RowBuffer> b,
|
||||
Reference<RowCursor> edit,
|
||||
TypeArgumentList typeArgs,
|
||||
OutObject<RowCursor> value
|
||||
Out<RowCursor> value
|
||||
) {
|
||||
return WriteScope(b, edit, typeArgs, value, UpdateOptions.Upsert);
|
||||
}
|
||||
@@ -44,8 +44,8 @@ public final class LayoutArray extends LayoutIndexedScope {
|
||||
//ORIGINAL LINE: public override Result WriteScope(ref RowBuffer b, ref RowCursor edit, TypeArgumentList
|
||||
// typeArgs, out RowCursor value, UpdateOptions options = UpdateOptions.Upsert)
|
||||
@Override
|
||||
public Result WriteScope(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
||||
TypeArgumentList typeArgs, OutObject<RowCursor> value, UpdateOptions options) {
|
||||
public Result WriteScope(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||
TypeArgumentList typeArgs, Out<RowCursor> value, UpdateOptions options) {
|
||||
Result result = PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options);
|
||||
if (result != Result.Success) {
|
||||
value.set(null);
|
||||
|
||||
@@ -4,8 +4,9 @@
|
||||
|
||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
||||
|
||||
import com.azure.data.cosmos.core.OutObject;
|
||||
import com.azure.data.cosmos.core.RefObject;
|
||||
import com.azure.data.cosmos.core.Out;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.Result;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
||||
@@ -35,11 +36,11 @@ public final class LayoutBinary extends LayoutType<byte[]> implements ILayoutSpa
|
||||
//ORIGINAL LINE: public override Result ReadFixed(ref RowBuffer b, ref RowCursor scope, LayoutColumn col, out
|
||||
// byte[] value)
|
||||
@Override
|
||||
public Result ReadFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
||||
OutObject<byte[]> value) {
|
||||
public Result ReadFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col,
|
||||
Out<byte[]> value) {
|
||||
ReadOnlySpan<Byte> span;
|
||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
|
||||
// cannot be converted using the 'OutObject' helper class unless the method is within the code being modified:
|
||||
// cannot be converted using the 'Out' helper class unless the method is within the code being modified:
|
||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||
//ORIGINAL LINE: Result r = this.ReadFixed(ref b, ref scope, col, out ReadOnlySpan<byte> span);
|
||||
Result r = this.ReadFixed(b, scope, col, out span);
|
||||
@@ -51,8 +52,8 @@ public final class LayoutBinary extends LayoutType<byte[]> implements ILayoutSpa
|
||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||
//ORIGINAL LINE: public Result ReadFixed(ref RowBuffer b, ref RowCursor scope, LayoutColumn col, out
|
||||
// ReadOnlySpan<byte> value)
|
||||
public Result ReadFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
||||
OutObject<ReadOnlySpan<Byte>> value) {
|
||||
public Result ReadFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col,
|
||||
Out<ReadOnlySpan<Byte>> value) {
|
||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||
checkArgument(col.getSize() >= 0);
|
||||
if (!b.get().ReadBit(scope.get().start, col.getNullBit().clone())) {
|
||||
@@ -67,10 +68,10 @@ public final class LayoutBinary extends LayoutType<byte[]> implements ILayoutSpa
|
||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||
//ORIGINAL LINE: public override Result ReadSparse(ref RowBuffer b, ref RowCursor edit, out byte[] value)
|
||||
@Override
|
||||
public Result ReadSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
||||
OutObject<byte[]> value) {
|
||||
public Result ReadSparse(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||
Out<byte[]> value) {
|
||||
ReadOnlySpan<Byte> span;
|
||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot be converted using the 'OutObject' helper class unless the method is within the code being modified:
|
||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot be converted using the 'Out' helper class unless the method is within the code being modified:
|
||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||
//ORIGINAL LINE: Result r = this.ReadSparse(ref b, ref edit, out ReadOnlySpan<byte> span);
|
||||
Result r = this.ReadSparse(b, edit, out span);
|
||||
@@ -81,7 +82,7 @@ public final class LayoutBinary extends LayoutType<byte[]> implements ILayoutSpa
|
||||
|
||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||
//ORIGINAL LINE: public Result ReadSparse(ref RowBuffer b, ref RowCursor edit, out ReadOnlySpan<byte> value)
|
||||
public Result ReadSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit, OutObject<ReadOnlySpan<Byte>> value) {
|
||||
public Result ReadSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, Out<ReadOnlySpan<Byte>> value) {
|
||||
Result result = LayoutType.PrepareSparseRead(b, edit, this.LayoutCode);
|
||||
if (result != Result.Success) {
|
||||
value.set(null);
|
||||
@@ -96,11 +97,11 @@ public final class LayoutBinary extends LayoutType<byte[]> implements ILayoutSpa
|
||||
//ORIGINAL LINE: public override Result ReadVariable(ref RowBuffer b, ref RowCursor scope, LayoutColumn col, out
|
||||
// byte[] value)
|
||||
@Override
|
||||
public Result ReadVariable(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col
|
||||
, OutObject<byte[]> value) {
|
||||
public Result ReadVariable(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col
|
||||
, Out<byte[]> value) {
|
||||
ReadOnlySpan<Byte> span;
|
||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
|
||||
// cannot be converted using the 'OutObject' helper class unless the method is within the code being modified:
|
||||
// cannot be converted using the 'Out' helper class unless the method is within the code being modified:
|
||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||
//ORIGINAL LINE: Result r = this.ReadVariable(ref b, ref scope, col, out ReadOnlySpan<byte> span);
|
||||
Result r = this.ReadVariable(b, scope, col, out span);
|
||||
@@ -112,8 +113,8 @@ public final class LayoutBinary extends LayoutType<byte[]> implements ILayoutSpa
|
||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||
//ORIGINAL LINE: public Result ReadVariable(ref RowBuffer b, ref RowCursor scope, LayoutColumn col, out
|
||||
// ReadOnlySpan<byte> value)
|
||||
public Result ReadVariable(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col
|
||||
, OutObject<ReadOnlySpan<Byte>> value) {
|
||||
public Result ReadVariable(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col
|
||||
, Out<ReadOnlySpan<Byte>> value) {
|
||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||
if (!b.get().ReadBit(scope.get().start, col.getNullBit().clone())) {
|
||||
value.set(null);
|
||||
@@ -130,7 +131,7 @@ public final class LayoutBinary extends LayoutType<byte[]> implements ILayoutSpa
|
||||
//ORIGINAL LINE: public override Result WriteFixed(ref RowBuffer b, ref RowCursor scope, LayoutColumn col, byte[]
|
||||
// value)
|
||||
@Override
|
||||
public Result WriteFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
||||
public Result WriteFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col,
|
||||
byte[] value) {
|
||||
checkArgument(value != null);
|
||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||
@@ -141,7 +142,7 @@ public final class LayoutBinary extends LayoutType<byte[]> implements ILayoutSpa
|
||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||
//ORIGINAL LINE: public Result WriteFixed(ref RowBuffer b, ref RowCursor scope, LayoutColumn col,
|
||||
// ReadOnlySpan<byte> value)
|
||||
public Result WriteFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
||||
public Result WriteFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col,
|
||||
ReadOnlySpan<Byte> value) {
|
||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||
checkArgument(col.getSize() >= 0);
|
||||
@@ -158,7 +159,7 @@ public final class LayoutBinary extends LayoutType<byte[]> implements ILayoutSpa
|
||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||
//ORIGINAL LINE: public Result WriteFixed(ref RowBuffer b, ref RowCursor scope, LayoutColumn col,
|
||||
// ReadOnlySequence<byte> value)
|
||||
public Result WriteFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
||||
public Result WriteFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col,
|
||||
ReadOnlySequence<Byte> value) {
|
||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||
checkArgument(col.getSize() >= 0);
|
||||
@@ -173,7 +174,7 @@ public final class LayoutBinary extends LayoutType<byte[]> implements ILayoutSpa
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result WriteSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit, byte[] value) {
|
||||
public Result WriteSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, byte[] value) {
|
||||
return WriteSparse(b, edit, value, UpdateOptions.Upsert);
|
||||
}
|
||||
|
||||
@@ -182,7 +183,7 @@ public final class LayoutBinary extends LayoutType<byte[]> implements ILayoutSpa
|
||||
// UpdateOptions options = UpdateOptions.Upsert)
|
||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||
@Override
|
||||
public Result WriteSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit, byte[] value,
|
||||
public Result WriteSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, byte[] value,
|
||||
UpdateOptions options) {
|
||||
checkArgument(value != null);
|
||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||
@@ -190,7 +191,7 @@ public final class LayoutBinary extends LayoutType<byte[]> implements ILayoutSpa
|
||||
return this.WriteSparse(b, edit, new ReadOnlySpan<Byte>(value), options);
|
||||
}
|
||||
|
||||
public Result WriteSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
||||
public Result WriteSparse(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||
ReadOnlySpan<Byte> value) {
|
||||
return WriteSparse(b, edit, value, UpdateOptions.Upsert);
|
||||
}
|
||||
@@ -199,7 +200,7 @@ public final class LayoutBinary extends LayoutType<byte[]> implements ILayoutSpa
|
||||
//ORIGINAL LINE: public Result WriteSparse(ref RowBuffer b, ref RowCursor edit, ReadOnlySpan<byte> value,
|
||||
// UpdateOptions options = UpdateOptions.Upsert)
|
||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||
public Result WriteSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
||||
public Result WriteSparse(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||
ReadOnlySpan<Byte> value, UpdateOptions options) {
|
||||
Result result = LayoutType.PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options);
|
||||
if (result != Result.Success) {
|
||||
@@ -210,7 +211,7 @@ public final class LayoutBinary extends LayoutType<byte[]> implements ILayoutSpa
|
||||
return Result.Success;
|
||||
}
|
||||
|
||||
public Result WriteSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
||||
public Result WriteSparse(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||
ReadOnlySequence<Byte> value) {
|
||||
return WriteSparse(b, edit, value, UpdateOptions.Upsert);
|
||||
}
|
||||
@@ -219,7 +220,7 @@ public final class LayoutBinary extends LayoutType<byte[]> implements ILayoutSpa
|
||||
//ORIGINAL LINE: public Result WriteSparse(ref RowBuffer b, ref RowCursor edit, ReadOnlySequence<byte> value,
|
||||
// UpdateOptions options = UpdateOptions.Upsert)
|
||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||
public Result WriteSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
||||
public Result WriteSparse(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||
ReadOnlySequence<Byte> value, UpdateOptions options) {
|
||||
Result result = LayoutType.PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options);
|
||||
if (result != Result.Success) {
|
||||
@@ -234,7 +235,7 @@ public final class LayoutBinary extends LayoutType<byte[]> implements ILayoutSpa
|
||||
//ORIGINAL LINE: public override Result WriteVariable(ref RowBuffer b, ref RowCursor scope, LayoutColumn col,
|
||||
// byte[] value)
|
||||
@Override
|
||||
public Result WriteVariable(RefObject<RowBuffer> b, RefObject<RowCursor> scope,
|
||||
public Result WriteVariable(Reference<RowBuffer> b, Reference<RowCursor> scope,
|
||||
LayoutColumn col, byte[] value) {
|
||||
checkArgument(value != null);
|
||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||
@@ -245,7 +246,7 @@ public final class LayoutBinary extends LayoutType<byte[]> implements ILayoutSpa
|
||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||
//ORIGINAL LINE: public Result WriteVariable(ref RowBuffer b, ref RowCursor scope, LayoutColumn col,
|
||||
// ReadOnlySpan<byte> value)
|
||||
public Result WriteVariable(RefObject<RowBuffer> b, RefObject<RowCursor> scope,
|
||||
public Result WriteVariable(Reference<RowBuffer> b, Reference<RowCursor> scope,
|
||||
LayoutColumn col, ReadOnlySpan<Byte> value) {
|
||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||
if (scope.get().immutable) {
|
||||
@@ -261,7 +262,7 @@ public final class LayoutBinary extends LayoutType<byte[]> implements ILayoutSpa
|
||||
int varOffset = b.get().ComputeVariableValueOffset(scope.get().layout, scope.get().start,
|
||||
col.getOffset());
|
||||
int shift;
|
||||
OutObject<Integer> tempOut_shift = new OutObject<Integer>();
|
||||
Out<Integer> tempOut_shift = new Out<Integer>();
|
||||
b.get().WriteVariableBinary(varOffset, value, exists, tempOut_shift);
|
||||
shift = tempOut_shift.get();
|
||||
b.get().SetBit(scope.get().start, col.getNullBit().clone());
|
||||
@@ -273,7 +274,7 @@ public final class LayoutBinary extends LayoutType<byte[]> implements ILayoutSpa
|
||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||
//ORIGINAL LINE: public Result WriteVariable(ref RowBuffer b, ref RowCursor scope, LayoutColumn col,
|
||||
// ReadOnlySequence<byte> value)
|
||||
public Result WriteVariable(RefObject<RowBuffer> b, RefObject<RowCursor> scope,
|
||||
public Result WriteVariable(Reference<RowBuffer> b, Reference<RowCursor> scope,
|
||||
LayoutColumn col, ReadOnlySequence<Byte> value) {
|
||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||
if (scope.get().immutable) {
|
||||
@@ -289,7 +290,7 @@ public final class LayoutBinary extends LayoutType<byte[]> implements ILayoutSpa
|
||||
int varOffset = b.get().ComputeVariableValueOffset(scope.get().layout, scope.get().start,
|
||||
col.getOffset());
|
||||
int shift;
|
||||
OutObject<Integer> tempOut_shift = new OutObject<Integer>();
|
||||
Out<Integer> tempOut_shift = new Out<Integer>();
|
||||
b.get().WriteVariableBinary(varOffset, value, exists, tempOut_shift);
|
||||
shift = tempOut_shift.get();
|
||||
b.get().SetBit(scope.get().start, col.getNullBit().clone());
|
||||
|
||||
@@ -22,7 +22,7 @@ public final class LayoutBit implements IEquatable<LayoutBit> {
|
||||
private int index;
|
||||
|
||||
/**
|
||||
* Initializes a new instance of the <see cref="LayoutBit" /> struct.
|
||||
* Initializes a new instance of the {@link LayoutBit} struct.
|
||||
*
|
||||
* @param index The 0-based offset into the layout bitmask.
|
||||
*/
|
||||
@@ -47,7 +47,7 @@ public final class LayoutBit implements IEquatable<LayoutBit> {
|
||||
|
||||
/**
|
||||
* Returns the 0-based bit from the beginning of the byte that contains this bit.
|
||||
* Also see <see cref="GetOffset" /> to identify relevant byte.
|
||||
* Also see {@link GetOffset} to identify relevant byte.
|
||||
*
|
||||
* @return The bit of the byte within the bitmask.
|
||||
*/
|
||||
@@ -61,7 +61,7 @@ public final class LayoutBit implements IEquatable<LayoutBit> {
|
||||
* Returns the 0-based byte offset from the beginning of the row or scope that contains the
|
||||
* bit from the bitmask.
|
||||
* <p>
|
||||
* Also see <see cref="GetBit" /> to identify.
|
||||
* Also see {@link GetBit} to identify.
|
||||
*
|
||||
* @param offset The byte offset from the beginning of the row where the scope begins.
|
||||
* @return The byte offset containing this bit.
|
||||
@@ -130,7 +130,7 @@ public final class LayoutBit implements IEquatable<LayoutBit> {
|
||||
private int next;
|
||||
|
||||
/**
|
||||
* Initializes a new instance of the <see cref="Allocator" /> class.
|
||||
* Initializes a new instance of the {@link Allocator} class.
|
||||
*/
|
||||
public Allocator() {
|
||||
this.next = 0;
|
||||
|
||||
@@ -4,8 +4,9 @@
|
||||
|
||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
||||
|
||||
import com.azure.data.cosmos.core.OutObject;
|
||||
import com.azure.data.cosmos.core.RefObject;
|
||||
import com.azure.data.cosmos.core.Out;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.Result;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
||||
@@ -33,8 +34,8 @@ public final class LayoutBoolean extends LayoutType<Boolean> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result ReadFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
||||
OutObject<Boolean> value) {
|
||||
public Result ReadFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col,
|
||||
Out<Boolean> value) {
|
||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||
if (!b.get().ReadBit(scope.get().start, col.getNullBit().clone())) {
|
||||
value.set(false);
|
||||
@@ -46,8 +47,8 @@ public final class LayoutBoolean extends LayoutType<Boolean> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result ReadSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
||||
OutObject<Boolean> value) {
|
||||
public Result ReadSparse(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||
Out<Boolean> value) {
|
||||
Result result = LayoutType.PrepareSparseRead(b, edit, this.LayoutCode);
|
||||
if (result != Result.Success) {
|
||||
value.set(false);
|
||||
@@ -59,7 +60,7 @@ public final class LayoutBoolean extends LayoutType<Boolean> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result WriteFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
||||
public Result WriteFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col,
|
||||
boolean value) {
|
||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||
if (scope.get().immutable) {
|
||||
@@ -80,7 +81,7 @@ public final class LayoutBoolean extends LayoutType<Boolean> {
|
||||
//ORIGINAL LINE: public override Result WriteSparse(ref RowBuffer b, ref RowCursor edit, bool value,
|
||||
// UpdateOptions options = UpdateOptions.Upsert)
|
||||
@Override
|
||||
public Result WriteSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit, boolean value,
|
||||
public Result WriteSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, boolean value,
|
||||
UpdateOptions options) {
|
||||
Result result = LayoutType.PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options);
|
||||
if (result != Result.Success) {
|
||||
@@ -92,7 +93,7 @@ public final class LayoutBoolean extends LayoutType<Boolean> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result WriteSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit, boolean value) {
|
||||
public Result WriteSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, boolean value) {
|
||||
return WriteSparse(b, edit, value, UpdateOptions.Upsert);
|
||||
}
|
||||
}
|
||||
@@ -18,7 +18,7 @@ public final class LayoutCodeTraits {
|
||||
/**
|
||||
* Returns a canonicalized version of the layout code.
|
||||
* <p>
|
||||
* Some codes (e.g. <see cref="LayoutCode.Boolean" /> use multiple type codes to also encode
|
||||
* Some codes (e.g. {@link LayoutCode.Boolean} use multiple type codes to also encode
|
||||
* values. This function converts actual value based code into the canonicalized type code for schema
|
||||
* comparisons.
|
||||
*
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
||||
|
||||
import com.azure.data.cosmos.core.Utf8String;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.schemas.StorageKind;
|
||||
|
||||
import static com.google.common.base.Strings.lenientFormat;
|
||||
@@ -30,13 +31,13 @@ public final class LayoutColumn {
|
||||
*/
|
||||
private LayoutBit nullBit = new LayoutBit();
|
||||
/**
|
||||
* If <see cref="storage" /> equals <see cref="StorageKind.Fixed" /> then the byte offset to
|
||||
* If {@link storage} equals {@link StorageKind.Fixed} then the byte offset to
|
||||
* the field location.
|
||||
* <para />
|
||||
* If <see cref="storage" /> equals <see cref="StorageKind.Variable" /> then the 0-based index of the
|
||||
* If {@link storage} equals {@link StorageKind.Variable} then the 0-based index of the
|
||||
* field from the beginning of the variable length segment.
|
||||
* <para />
|
||||
* For all other values of <see cref="storage" />, <see cref="Offset" /> is ignored.
|
||||
* For all other values of {@link storage}, {@link Offset} is ignored.
|
||||
*/
|
||||
private int offset;
|
||||
/**
|
||||
@@ -48,7 +49,7 @@ public final class LayoutColumn {
|
||||
*/
|
||||
private Utf8String path;
|
||||
/**
|
||||
* If <see cref="LayoutType.IsBool" /> then the 0-based extra index within the bool byte
|
||||
* If {@link LayoutType.IsBool} then the 0-based extra index within the bool byte
|
||||
* holding the value of this type, otherwise must be 0.
|
||||
*/
|
||||
private int size;
|
||||
@@ -65,12 +66,12 @@ public final class LayoutColumn {
|
||||
*/
|
||||
private TypeArgument typeArg = new TypeArgument();
|
||||
/**
|
||||
* For types with generic parameters (e.g. <see cref="LayoutTuple" />, the type parameters.
|
||||
* For types with generic parameters (e.g. {@link LayoutTuple}, the type parameters.
|
||||
*/
|
||||
private TypeArgumentList typeArgs = new TypeArgumentList();
|
||||
|
||||
/**
|
||||
* Initializes a new instance of the <see cref="LayoutColumn" /> class.
|
||||
* Initializes a new instance of the {@link LayoutColumn} class.
|
||||
*
|
||||
* @param path The path to the field relative to parent scope.
|
||||
* @param type Type of the field.
|
||||
@@ -81,7 +82,7 @@ public final class LayoutColumn {
|
||||
* @param nullBit 0-based index into the bit mask for the null bit.
|
||||
* @param boolBit For bool fields, 0-based index into the bit mask for the bool value.
|
||||
* @param length For variable length types the length, otherwise 0.
|
||||
* @param typeArgs For types with generic parameters (e.g. <see cref="LayoutTuple" />, the type
|
||||
* @param typeArgs For types with generic parameters (e.g. {@link LayoutTuple}, the type
|
||||
* parameters.
|
||||
*/
|
||||
|
||||
@@ -112,8 +113,8 @@ public final class LayoutColumn {
|
||||
/**
|
||||
* The full logical path of the field within the row.
|
||||
* <p>
|
||||
* Paths are expressed in dotted notation: e.g. a relative <see cref="Path" /> of 'b.c'
|
||||
* within the scope 'a' yields a <see cref="FullPath" /> of 'a.b.c'.
|
||||
* Paths are expressed in dotted notation: e.g. a relative {@link Path} of 'b.c'
|
||||
* within the scope 'a' yields a {@link FullPath} of 'a.b.c'.
|
||||
*/
|
||||
public Utf8String getFullPath() {
|
||||
return this.fullPath;
|
||||
@@ -137,8 +138,8 @@ public final class LayoutColumn {
|
||||
/**
|
||||
* The relative path of the field within its parent scope.
|
||||
* <p>
|
||||
* Paths are expressed in dotted notation: e.g. a relative <see cref="Path" /> of 'b.c'
|
||||
* within the scope 'a' yields a <see cref="FullPath" /> of 'a.b.c'.
|
||||
* Paths are expressed in dotted notation: e.g. a relative {@link Path} of 'b.c'
|
||||
* within the scope 'a' yields a {@link FullPath} of 'a.b.c'.
|
||||
*/
|
||||
public Utf8String getPath() {
|
||||
return this.path;
|
||||
@@ -166,7 +167,7 @@ public final class LayoutColumn {
|
||||
}
|
||||
|
||||
/**
|
||||
* For types with generic parameters (e.g. <see cref="LayoutTuple" />, the type parameters.
|
||||
* For types with generic parameters (e.g. {@link LayoutTuple}, the type parameters.
|
||||
*/
|
||||
public TypeArgumentList getTypeArgs() {
|
||||
return this.typeArgs.clone();
|
||||
@@ -200,21 +201,21 @@ public final class LayoutColumn {
|
||||
LayoutBit getNullBit()
|
||||
|
||||
/**
|
||||
* If <see cref="storage" /> equals <see cref="StorageKind.Fixed" /> then the byte offset to
|
||||
* If {@link storage} equals {@link StorageKind.Fixed} then the byte offset to
|
||||
* the field location.
|
||||
* <para />
|
||||
* If <see cref="storage" /> equals <see cref="StorageKind.Variable" /> then the 0-based index of the
|
||||
* If {@link storage} equals {@link StorageKind.Variable} then the 0-based index of the
|
||||
* field from the beginning of the variable length segment.
|
||||
* <para />
|
||||
* For all other values of <see cref="storage" />, <see cref="Offset" /> is ignored.
|
||||
* For all other values of {@link storage}, {@link Offset} is ignored.
|
||||
*/
|
||||
int getOffset()
|
||||
|
||||
/**
|
||||
* If <see cref="storage" /> equals <see cref="StorageKind.Fixed" /> then the fixed number of
|
||||
* If {@link storage} equals {@link StorageKind.Fixed} then the fixed number of
|
||||
* bytes reserved for the value.
|
||||
* <para />
|
||||
* If <see cref="storage" /> equals <see cref="StorageKind.Variable" /> then the maximum number of
|
||||
* If {@link storage} equals {@link StorageKind.Variable} then the maximum number of
|
||||
* bytes allowed for the value.
|
||||
*/
|
||||
int getSize()
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
||||
|
||||
import com.azure.data.cosmos.core.OutObject;
|
||||
import com.azure.data.cosmos.core.Out;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.SchemaId;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.schemas.ArrayPropertyType;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.schemas.MapPropertyType;
|
||||
@@ -53,8 +53,8 @@ public final class LayoutCompiler {
|
||||
ArrayList<Property> properties) {
|
||||
for (Property p : properties) {
|
||||
TypeArgumentList typeArgs = new TypeArgumentList();
|
||||
OutObject<TypeArgumentList> tempOut_typeArgs =
|
||||
new OutObject<TypeArgumentList>();
|
||||
Out<TypeArgumentList> tempOut_typeArgs =
|
||||
new Out<TypeArgumentList>();
|
||||
LayoutType type = LayoutCompiler.LogicalToPhysicalType(ns, p.getPropertyType(), tempOut_typeArgs);
|
||||
typeArgs = tempOut_typeArgs.get();
|
||||
switch (LayoutCodeTraits.ClearImmutableBit(type.LayoutCode)) {
|
||||
@@ -149,7 +149,7 @@ public final class LayoutCompiler {
|
||||
}
|
||||
|
||||
private static LayoutType LogicalToPhysicalType(Namespace ns, PropertyType logicalType,
|
||||
OutObject<TypeArgumentList> typeArgs) {
|
||||
Out<TypeArgumentList> typeArgs) {
|
||||
typeArgs.set(TypeArgumentList.Empty);
|
||||
boolean tempVar =
|
||||
(logicalType instanceof ScopePropertyType ? (ScopePropertyType)logicalType : null).getImmutable();
|
||||
@@ -209,7 +209,7 @@ public final class LayoutCompiler {
|
||||
ArrayPropertyType ap = (ArrayPropertyType)logicalType;
|
||||
if ((ap.getItems() != null) && (ap.getItems().getType() != TypeKind.Any)) {
|
||||
TypeArgumentList itemTypeArgs = new TypeArgumentList();
|
||||
OutObject<TypeArgumentList> tempOut_itemTypeArgs = new OutObject<TypeArgumentList>();
|
||||
Out<TypeArgumentList> tempOut_itemTypeArgs = new Out<TypeArgumentList>();
|
||||
LayoutType itemType = LayoutCompiler.LogicalToPhysicalType(ns, ap.getItems(), tempOut_itemTypeArgs);
|
||||
itemTypeArgs = tempOut_itemTypeArgs.get();
|
||||
if (ap.getItems().getNullable()) {
|
||||
@@ -228,7 +228,7 @@ public final class LayoutCompiler {
|
||||
SetPropertyType sp = (SetPropertyType)logicalType;
|
||||
if ((sp.getItems() != null) && (sp.getItems().getType() != TypeKind.Any)) {
|
||||
TypeArgumentList itemTypeArgs = new TypeArgumentList();
|
||||
OutObject<TypeArgumentList> tempOut_itemTypeArgs2 = new OutObject<TypeArgumentList>();
|
||||
Out<TypeArgumentList> tempOut_itemTypeArgs2 = new Out<TypeArgumentList>();
|
||||
LayoutType itemType = LayoutCompiler.LogicalToPhysicalType(ns, sp.getItems(),
|
||||
tempOut_itemTypeArgs2);
|
||||
itemTypeArgs = tempOut_itemTypeArgs2.get();
|
||||
@@ -251,7 +251,7 @@ public final class LayoutCompiler {
|
||||
MapPropertyType mp = (MapPropertyType)logicalType;
|
||||
if ((mp.getKeys() != null) && (mp.getKeys().getType() != TypeKind.Any) && (mp.getValues() != null) && (mp.getValues().getType() != TypeKind.Any)) {
|
||||
TypeArgumentList keyTypeArgs = new TypeArgumentList();
|
||||
OutObject<TypeArgumentList> tempOut_keyTypeArgs = new OutObject<TypeArgumentList>();
|
||||
Out<TypeArgumentList> tempOut_keyTypeArgs = new Out<TypeArgumentList>();
|
||||
LayoutType keyType = LayoutCompiler.LogicalToPhysicalType(ns, mp.getKeys(), tempOut_keyTypeArgs);
|
||||
keyTypeArgs = tempOut_keyTypeArgs.get();
|
||||
if (mp.getKeys().getNullable()) {
|
||||
@@ -261,7 +261,7 @@ public final class LayoutCompiler {
|
||||
}
|
||||
|
||||
TypeArgumentList valueTypeArgs = new TypeArgumentList();
|
||||
OutObject<TypeArgumentList> tempOut_valueTypeArgs = new OutObject<TypeArgumentList>();
|
||||
Out<TypeArgumentList> tempOut_valueTypeArgs = new Out<TypeArgumentList>();
|
||||
LayoutType valueType = LayoutCompiler.LogicalToPhysicalType(ns, mp.getValues(),
|
||||
tempOut_valueTypeArgs);
|
||||
valueTypeArgs = tempOut_valueTypeArgs.get();
|
||||
@@ -288,7 +288,7 @@ public final class LayoutCompiler {
|
||||
TypeArgument[] args = new TypeArgument[tp.getItems().size()];
|
||||
for (int i = 0; i < tp.getItems().size(); i++) {
|
||||
TypeArgumentList itemTypeArgs = new TypeArgumentList();
|
||||
OutObject<TypeArgumentList> tempOut_itemTypeArgs3 = new OutObject<TypeArgumentList>();
|
||||
Out<TypeArgumentList> tempOut_itemTypeArgs3 = new Out<TypeArgumentList>();
|
||||
LayoutType itemType = LayoutCompiler.LogicalToPhysicalType(ns, tp.getItems().get(i),
|
||||
tempOut_itemTypeArgs3);
|
||||
itemTypeArgs = tempOut_itemTypeArgs3.get();
|
||||
@@ -316,7 +316,7 @@ public final class LayoutCompiler {
|
||||
tgArgs[0] = new TypeArgument(LayoutType.UInt8, TypeArgumentList.Empty);
|
||||
for (int i = 0; i < tg.getItems().size(); i++) {
|
||||
TypeArgumentList itemTypeArgs = new TypeArgumentList();
|
||||
OutObject<TypeArgumentList> tempOut_itemTypeArgs4 = new OutObject<TypeArgumentList>();
|
||||
Out<TypeArgumentList> tempOut_itemTypeArgs4 = new Out<TypeArgumentList>();
|
||||
LayoutType itemType = LayoutCompiler.LogicalToPhysicalType(ns, tg.getItems().get(i),
|
||||
tempOut_itemTypeArgs4);
|
||||
itemTypeArgs = tempOut_itemTypeArgs4.get();
|
||||
|
||||
@@ -4,8 +4,9 @@
|
||||
|
||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
||||
|
||||
import com.azure.data.cosmos.core.OutObject;
|
||||
import com.azure.data.cosmos.core.RefObject;
|
||||
import com.azure.data.cosmos.core.Out;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.Result;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
||||
@@ -30,8 +31,8 @@ public final class LayoutDateTime extends LayoutType<DateTime> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result ReadFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
||||
OutObject<LocalDateTime> value) {
|
||||
public Result ReadFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col,
|
||||
Out<LocalDateTime> value) {
|
||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||
if (!b.get().ReadBit(scope.get().start, col.getNullBit().clone())) {
|
||||
value.set(LocalDateTime.MIN);
|
||||
@@ -43,8 +44,8 @@ public final class LayoutDateTime extends LayoutType<DateTime> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result ReadSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
||||
OutObject<LocalDateTime> value) {
|
||||
public Result ReadSparse(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||
Out<LocalDateTime> value) {
|
||||
Result result = LayoutType.PrepareSparseRead(b, edit, this.LayoutCode);
|
||||
if (result != Result.Success) {
|
||||
value.set(LocalDateTime.MIN);
|
||||
@@ -56,7 +57,7 @@ public final class LayoutDateTime extends LayoutType<DateTime> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result WriteFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
||||
public Result WriteFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col,
|
||||
LocalDateTime value) {
|
||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||
if (scope.get().immutable) {
|
||||
@@ -72,7 +73,7 @@ public final class LayoutDateTime extends LayoutType<DateTime> {
|
||||
//ORIGINAL LINE: public override Result WriteSparse(ref RowBuffer b, ref RowCursor edit, DateTime value,
|
||||
// UpdateOptions options = UpdateOptions.Upsert)
|
||||
@Override
|
||||
public Result WriteSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
||||
public Result WriteSparse(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||
LocalDateTime value, UpdateOptions options) {
|
||||
Result result = LayoutType.PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options);
|
||||
if (result != Result.Success) {
|
||||
@@ -84,7 +85,7 @@ public final class LayoutDateTime extends LayoutType<DateTime> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result WriteSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit, DateTime value) {
|
||||
public Result WriteSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, DateTime value) {
|
||||
return WriteSparse(b, edit, value, UpdateOptions.Upsert);
|
||||
}
|
||||
}
|
||||
@@ -4,8 +4,9 @@
|
||||
|
||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
||||
|
||||
import com.azure.data.cosmos.core.OutObject;
|
||||
import com.azure.data.cosmos.core.RefObject;
|
||||
import com.azure.data.cosmos.core.Out;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.Result;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
||||
@@ -31,8 +32,8 @@ public final class LayoutDecimal extends LayoutType<BigDecimal> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result ReadFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
||||
OutObject<BigDecimal> value) {
|
||||
public Result ReadFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col,
|
||||
Out<BigDecimal> value) {
|
||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||
if (!b.get().ReadBit(scope.get().start, col.getNullBit().clone())) {
|
||||
value.set(new BigDecimal(0));
|
||||
@@ -44,8 +45,8 @@ public final class LayoutDecimal extends LayoutType<BigDecimal> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result ReadSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
||||
OutObject<BigDecimal> value) {
|
||||
public Result ReadSparse(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||
Out<BigDecimal> value) {
|
||||
Result result = LayoutType.PrepareSparseRead(b, edit, this.LayoutCode);
|
||||
if (result != Result.Success) {
|
||||
value.set(new BigDecimal(0));
|
||||
@@ -57,7 +58,7 @@ public final class LayoutDecimal extends LayoutType<BigDecimal> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result WriteFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
||||
public Result WriteFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col,
|
||||
BigDecimal value) {
|
||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||
if (scope.get().immutable) {
|
||||
@@ -73,7 +74,7 @@ public final class LayoutDecimal extends LayoutType<BigDecimal> {
|
||||
//ORIGINAL LINE: public override Result WriteSparse(ref RowBuffer b, ref RowCursor edit, decimal value,
|
||||
// UpdateOptions options = UpdateOptions.Upsert)
|
||||
@Override
|
||||
public Result WriteSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit, BigDecimal value,
|
||||
public Result WriteSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, BigDecimal value,
|
||||
UpdateOptions options) {
|
||||
Result result = LayoutType.PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options);
|
||||
if (result != Result.Success) {
|
||||
@@ -85,7 +86,7 @@ public final class LayoutDecimal extends LayoutType<BigDecimal> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result WriteSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
||||
public Result WriteSparse(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||
java.math.BigDecimal value) {
|
||||
return WriteSparse(b, edit, value, UpdateOptions.Upsert);
|
||||
}
|
||||
|
||||
@@ -4,8 +4,9 @@
|
||||
|
||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
||||
|
||||
import com.azure.data.cosmos.core.OutObject;
|
||||
import com.azure.data.cosmos.core.RefObject;
|
||||
import com.azure.data.cosmos.core.Out;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.Result;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
||||
@@ -27,8 +28,8 @@ public final class LayoutEndScope extends LayoutScope {
|
||||
|
||||
|
||||
@Override
|
||||
public Result WriteScope(RefObject<RowBuffer> b, RefObject<RowCursor> scope,
|
||||
TypeArgumentList typeArgs, OutObject<RowCursor> value) {
|
||||
public Result WriteScope(Reference<RowBuffer> b, Reference<RowCursor> scope,
|
||||
TypeArgumentList typeArgs, Out<RowCursor> value) {
|
||||
return WriteScope(b, scope, typeArgs, value, UpdateOptions.Upsert);
|
||||
}
|
||||
|
||||
@@ -36,8 +37,8 @@ public final class LayoutEndScope extends LayoutScope {
|
||||
//ORIGINAL LINE: public override Result WriteScope(ref RowBuffer b, ref RowCursor scope, TypeArgumentList
|
||||
// typeArgs, out RowCursor value, UpdateOptions options = UpdateOptions.Upsert)
|
||||
@Override
|
||||
public Result WriteScope(RefObject<RowBuffer> b, RefObject<RowCursor> scope,
|
||||
TypeArgumentList typeArgs, OutObject<RowCursor> value, UpdateOptions options) {
|
||||
public Result WriteScope(Reference<RowBuffer> b, Reference<RowCursor> scope,
|
||||
TypeArgumentList typeArgs, Out<RowCursor> value, UpdateOptions options) {
|
||||
Contract.Fail("Cannot write an EndScope directly");
|
||||
value.set(null);
|
||||
return Result.Failure;
|
||||
|
||||
@@ -4,8 +4,9 @@
|
||||
|
||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
||||
|
||||
import com.azure.data.cosmos.core.OutObject;
|
||||
import com.azure.data.cosmos.core.RefObject;
|
||||
import com.azure.data.cosmos.core.Out;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.Float128;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.Result;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||
@@ -29,8 +30,8 @@ public final class LayoutFloat128 extends LayoutType<com.azure.data.cosmos.seria
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result ReadFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
||||
OutObject<Float128> value) {
|
||||
public Result ReadFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col,
|
||||
Out<Float128> value) {
|
||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||
if (!b.get().ReadBit(scope.get().start, col.getNullBit().clone())) {
|
||||
value.set(null);
|
||||
@@ -42,8 +43,8 @@ public final class LayoutFloat128 extends LayoutType<com.azure.data.cosmos.seria
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result ReadSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
||||
OutObject<Float128> value) {
|
||||
public Result ReadSparse(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||
Out<Float128> value) {
|
||||
Result result = LayoutType.PrepareSparseRead(b, edit, this.LayoutCode);
|
||||
if (result != Result.Success) {
|
||||
value.set(null);
|
||||
@@ -55,7 +56,7 @@ public final class LayoutFloat128 extends LayoutType<com.azure.data.cosmos.seria
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result WriteFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
||||
public Result WriteFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col,
|
||||
Float128 value) {
|
||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||
if (scope.get().immutable) {
|
||||
@@ -71,7 +72,7 @@ public final class LayoutFloat128 extends LayoutType<com.azure.data.cosmos.seria
|
||||
//ORIGINAL LINE: public override Result WriteSparse(ref RowBuffer b, ref RowCursor edit, Float128 value,
|
||||
// UpdateOptions options = UpdateOptions.Upsert)
|
||||
@Override
|
||||
public Result WriteSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit, Float128 value,
|
||||
public Result WriteSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, Float128 value,
|
||||
UpdateOptions options) {
|
||||
Result result = LayoutType.PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options);
|
||||
if (result != Result.Success) {
|
||||
@@ -83,7 +84,7 @@ public final class LayoutFloat128 extends LayoutType<com.azure.data.cosmos.seria
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result WriteSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit, Float128 value) {
|
||||
public Result WriteSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, Float128 value) {
|
||||
return WriteSparse(b, edit, value, UpdateOptions.Upsert);
|
||||
}
|
||||
}
|
||||
@@ -4,8 +4,9 @@
|
||||
|
||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
||||
|
||||
import com.azure.data.cosmos.core.OutObject;
|
||||
import com.azure.data.cosmos.core.RefObject;
|
||||
import com.azure.data.cosmos.core.Out;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.Result;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
||||
@@ -28,8 +29,8 @@ public final class LayoutFloat32 extends LayoutType<Float> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result ReadFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
||||
OutObject<Float> value) {
|
||||
public Result ReadFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col,
|
||||
Out<Float> value) {
|
||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||
if (!b.get().ReadBit(scope.get().start, col.getNullBit().clone())) {
|
||||
value.set(0);
|
||||
@@ -41,8 +42,8 @@ public final class LayoutFloat32 extends LayoutType<Float> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result ReadSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
||||
OutObject<Float> value) {
|
||||
public Result ReadSparse(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||
Out<Float> value) {
|
||||
Result result = PrepareSparseRead(b, edit, this.LayoutCode);
|
||||
if (result != Result.Success) {
|
||||
value.set(0);
|
||||
@@ -54,7 +55,7 @@ public final class LayoutFloat32 extends LayoutType<Float> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result WriteFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
||||
public Result WriteFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col,
|
||||
float value) {
|
||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||
if (scope.get().immutable) {
|
||||
@@ -70,7 +71,7 @@ public final class LayoutFloat32 extends LayoutType<Float> {
|
||||
//ORIGINAL LINE: public override Result WriteSparse(ref RowBuffer b, ref RowCursor edit, float value,
|
||||
// UpdateOptions options = UpdateOptions.Upsert)
|
||||
@Override
|
||||
public Result WriteSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit, float value,
|
||||
public Result WriteSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, float value,
|
||||
UpdateOptions options) {
|
||||
Result result = PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options);
|
||||
if (result != Result.Success) {
|
||||
@@ -82,7 +83,7 @@ public final class LayoutFloat32 extends LayoutType<Float> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result WriteSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit, float value) {
|
||||
public Result WriteSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, float value) {
|
||||
return WriteSparse(b, edit, value, UpdateOptions.Upsert);
|
||||
}
|
||||
}
|
||||
@@ -4,8 +4,9 @@
|
||||
|
||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
||||
|
||||
import com.azure.data.cosmos.core.OutObject;
|
||||
import com.azure.data.cosmos.core.RefObject;
|
||||
import com.azure.data.cosmos.core.Out;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.Result;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
||||
@@ -28,8 +29,8 @@ public final class LayoutFloat64 extends LayoutType<Double> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result ReadFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
||||
OutObject<Double> value) {
|
||||
public Result ReadFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col,
|
||||
Out<Double> value) {
|
||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||
if (!b.get().ReadBit(scope.get().start, col.getNullBit().clone())) {
|
||||
value.set(0);
|
||||
@@ -41,8 +42,8 @@ public final class LayoutFloat64 extends LayoutType<Double> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result ReadSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
||||
OutObject<Double> value) {
|
||||
public Result ReadSparse(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||
Out<Double> value) {
|
||||
Result result = LayoutType.PrepareSparseRead(b, edit, this.LayoutCode);
|
||||
if (result != Result.Success) {
|
||||
value.set(0);
|
||||
@@ -54,7 +55,7 @@ public final class LayoutFloat64 extends LayoutType<Double> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result WriteFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
||||
public Result WriteFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col,
|
||||
double value) {
|
||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||
if (scope.get().immutable) {
|
||||
@@ -70,7 +71,7 @@ public final class LayoutFloat64 extends LayoutType<Double> {
|
||||
//ORIGINAL LINE: public override Result WriteSparse(ref RowBuffer b, ref RowCursor edit, double value,
|
||||
// UpdateOptions options = UpdateOptions.Upsert)
|
||||
@Override
|
||||
public Result WriteSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit, double value,
|
||||
public Result WriteSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, double value,
|
||||
UpdateOptions options) {
|
||||
Result result = LayoutType.PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options);
|
||||
if (result != Result.Success) {
|
||||
@@ -82,7 +83,7 @@ public final class LayoutFloat64 extends LayoutType<Double> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result WriteSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit, double value) {
|
||||
public Result WriteSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, double value) {
|
||||
return WriteSparse(b, edit, value, UpdateOptions.Upsert);
|
||||
}
|
||||
}
|
||||
@@ -4,8 +4,9 @@
|
||||
|
||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
||||
|
||||
import com.azure.data.cosmos.core.OutObject;
|
||||
import com.azure.data.cosmos.core.RefObject;
|
||||
import com.azure.data.cosmos.core.Out;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.Result;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
||||
@@ -30,8 +31,8 @@ public final class LayoutGuid extends LayoutType<UUID> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result ReadFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
||||
OutObject<UUID> value) {
|
||||
public Result ReadFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col,
|
||||
Out<UUID> value) {
|
||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||
if (!b.get().ReadBit(scope.get().start, col.getNullBit().clone())) {
|
||||
value.set(null);
|
||||
@@ -43,8 +44,8 @@ public final class LayoutGuid extends LayoutType<UUID> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result ReadSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
||||
OutObject<UUID> value) {
|
||||
public Result ReadSparse(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||
Out<UUID> value) {
|
||||
Result result = PrepareSparseRead(b, edit, this.LayoutCode);
|
||||
if (result != Result.Success) {
|
||||
value.set(null);
|
||||
@@ -56,7 +57,7 @@ public final class LayoutGuid extends LayoutType<UUID> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result WriteFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
||||
public Result WriteFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col,
|
||||
UUID value) {
|
||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||
if (scope.get().immutable) {
|
||||
@@ -72,7 +73,7 @@ public final class LayoutGuid extends LayoutType<UUID> {
|
||||
//ORIGINAL LINE: public override Result WriteSparse(ref RowBuffer b, ref RowCursor edit, Guid value,
|
||||
// UpdateOptions options = UpdateOptions.Upsert)
|
||||
@Override
|
||||
public Result WriteSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit, UUID value,
|
||||
public Result WriteSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, UUID value,
|
||||
UpdateOptions options) {
|
||||
Result result = PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options);
|
||||
if (result != Result.Success) {
|
||||
@@ -84,7 +85,7 @@ public final class LayoutGuid extends LayoutType<UUID> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result WriteSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
||||
public Result WriteSparse(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||
java.util.UUID value) {
|
||||
return WriteSparse(b, edit, value, UpdateOptions.Upsert);
|
||||
}
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
|
||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
||||
|
||||
import com.azure.data.cosmos.core.RefObject;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
||||
|
||||
@@ -22,7 +23,7 @@ public abstract class LayoutIndexedScope extends LayoutScope {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void ReadSparsePath(RefObject<RowBuffer> row, RefObject<RowCursor> edit) {
|
||||
public void ReadSparsePath(Reference<RowBuffer> row, Reference<RowCursor> edit) {
|
||||
edit.get().pathToken = 0;
|
||||
edit.get().pathOffset = 0;
|
||||
}
|
||||
|
||||
@@ -4,8 +4,9 @@
|
||||
|
||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
||||
|
||||
import com.azure.data.cosmos.core.OutObject;
|
||||
import com.azure.data.cosmos.core.RefObject;
|
||||
import com.azure.data.cosmos.core.Out;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.Result;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
||||
@@ -28,8 +29,8 @@ public final class LayoutInt16 extends LayoutType<Short> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result ReadFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
||||
OutObject<Short> value) {
|
||||
public Result ReadFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col,
|
||||
Out<Short> value) {
|
||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||
if (!b.get().ReadBit(scope.get().start, col.getNullBit().clone())) {
|
||||
value.set(0);
|
||||
@@ -41,8 +42,8 @@ public final class LayoutInt16 extends LayoutType<Short> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result ReadSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
||||
OutObject<Short> value) {
|
||||
public Result ReadSparse(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||
Out<Short> value) {
|
||||
Result result = PrepareSparseRead(b, edit, this.LayoutCode);
|
||||
if (result != Result.Success) {
|
||||
value.set(0);
|
||||
@@ -54,7 +55,7 @@ public final class LayoutInt16 extends LayoutType<Short> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result WriteFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
||||
public Result WriteFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col,
|
||||
short value) {
|
||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||
if (scope.get().immutable) {
|
||||
@@ -70,7 +71,7 @@ public final class LayoutInt16 extends LayoutType<Short> {
|
||||
//ORIGINAL LINE: public override Result WriteSparse(ref RowBuffer b, ref RowCursor edit, short value,
|
||||
// UpdateOptions options = UpdateOptions.Upsert)
|
||||
@Override
|
||||
public Result WriteSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit, short value,
|
||||
public Result WriteSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, short value,
|
||||
UpdateOptions options) {
|
||||
Result result = PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options);
|
||||
if (result != Result.Success) {
|
||||
@@ -82,7 +83,7 @@ public final class LayoutInt16 extends LayoutType<Short> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result WriteSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit, short value) {
|
||||
public Result WriteSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, short value) {
|
||||
return WriteSparse(b, edit, value, UpdateOptions.Upsert);
|
||||
}
|
||||
}
|
||||
@@ -4,8 +4,9 @@
|
||||
|
||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
||||
|
||||
import com.azure.data.cosmos.core.OutObject;
|
||||
import com.azure.data.cosmos.core.RefObject;
|
||||
import com.azure.data.cosmos.core.Out;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.Result;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
||||
@@ -28,8 +29,8 @@ public final class LayoutInt32 extends LayoutType<Integer> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result ReadFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
||||
OutObject<Integer> value) {
|
||||
public Result ReadFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col,
|
||||
Out<Integer> value) {
|
||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||
if (!b.get().ReadBit(scope.get().start, col.getNullBit().clone())) {
|
||||
value.set(0);
|
||||
@@ -41,8 +42,8 @@ public final class LayoutInt32 extends LayoutType<Integer> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result ReadSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
||||
OutObject<Integer> value) {
|
||||
public Result ReadSparse(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||
Out<Integer> value) {
|
||||
Result result = LayoutType.PrepareSparseRead(b, edit, this.LayoutCode);
|
||||
if (result != Result.Success) {
|
||||
value.set(0);
|
||||
@@ -54,7 +55,7 @@ public final class LayoutInt32 extends LayoutType<Integer> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result WriteFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
||||
public Result WriteFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col,
|
||||
int value) {
|
||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||
if (scope.get().immutable) {
|
||||
@@ -70,7 +71,7 @@ public final class LayoutInt32 extends LayoutType<Integer> {
|
||||
//ORIGINAL LINE: public override Result WriteSparse(ref RowBuffer b, ref RowCursor edit, int value, UpdateOptions
|
||||
// options = UpdateOptions.Upsert)
|
||||
@Override
|
||||
public Result WriteSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit, int value,
|
||||
public Result WriteSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, int value,
|
||||
UpdateOptions options) {
|
||||
Result result = LayoutType.PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options);
|
||||
if (result != Result.Success) {
|
||||
@@ -82,7 +83,7 @@ public final class LayoutInt32 extends LayoutType<Integer> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result WriteSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit, int value) {
|
||||
public Result WriteSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, int value) {
|
||||
return WriteSparse(b, edit, value, UpdateOptions.Upsert);
|
||||
}
|
||||
}
|
||||
@@ -4,8 +4,9 @@
|
||||
|
||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
||||
|
||||
import com.azure.data.cosmos.core.OutObject;
|
||||
import com.azure.data.cosmos.core.RefObject;
|
||||
import com.azure.data.cosmos.core.Out;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.Result;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
||||
@@ -28,8 +29,8 @@ public final class LayoutInt64 extends LayoutType<Long> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result ReadFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
||||
OutObject<Long> value) {
|
||||
public Result ReadFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col,
|
||||
Out<Long> value) {
|
||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||
if (!b.get().ReadBit(scope.get().start, col.getNullBit().clone())) {
|
||||
value.set(0);
|
||||
@@ -41,8 +42,8 @@ public final class LayoutInt64 extends LayoutType<Long> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result ReadSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
||||
OutObject<Long> value) {
|
||||
public Result ReadSparse(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||
Out<Long> value) {
|
||||
Result result = LayoutType.PrepareSparseRead(b, edit, this.LayoutCode);
|
||||
if (result != Result.Success) {
|
||||
value.set(0);
|
||||
@@ -54,7 +55,7 @@ public final class LayoutInt64 extends LayoutType<Long> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result WriteFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
||||
public Result WriteFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col,
|
||||
long value) {
|
||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||
if (scope.get().immutable) {
|
||||
@@ -70,7 +71,7 @@ public final class LayoutInt64 extends LayoutType<Long> {
|
||||
//ORIGINAL LINE: public override Result WriteSparse(ref RowBuffer b, ref RowCursor edit, long value,
|
||||
// UpdateOptions options = UpdateOptions.Upsert)
|
||||
@Override
|
||||
public Result WriteSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit, long value,
|
||||
public Result WriteSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, long value,
|
||||
UpdateOptions options) {
|
||||
Result result = LayoutType.PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options);
|
||||
if (result != Result.Success) {
|
||||
@@ -82,7 +83,7 @@ public final class LayoutInt64 extends LayoutType<Long> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result WriteSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit, long value) {
|
||||
public Result WriteSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, long value) {
|
||||
return WriteSparse(b, edit, value, UpdateOptions.Upsert);
|
||||
}
|
||||
}
|
||||
@@ -4,8 +4,9 @@
|
||||
|
||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
||||
|
||||
import com.azure.data.cosmos.core.OutObject;
|
||||
import com.azure.data.cosmos.core.RefObject;
|
||||
import com.azure.data.cosmos.core.Out;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.Result;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
||||
@@ -28,8 +29,8 @@ public final class LayoutInt8 extends LayoutType<Byte> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result ReadFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
||||
OutObject<Byte> value) {
|
||||
public Result ReadFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col,
|
||||
Out<Byte> value) {
|
||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||
if (!b.get().ReadBit(scope.get().start, col.getNullBit().clone())) {
|
||||
value.set(0);
|
||||
@@ -41,8 +42,8 @@ public final class LayoutInt8 extends LayoutType<Byte> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result ReadSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
||||
OutObject<Byte> value) {
|
||||
public Result ReadSparse(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||
Out<Byte> value) {
|
||||
Result result = LayoutType.PrepareSparseRead(b, edit, this.LayoutCode);
|
||||
if (result != Result.Success) {
|
||||
value.set(0);
|
||||
@@ -54,7 +55,7 @@ public final class LayoutInt8 extends LayoutType<Byte> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result WriteFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
||||
public Result WriteFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col,
|
||||
byte value) {
|
||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||
if (scope.get().immutable) {
|
||||
@@ -70,7 +71,7 @@ public final class LayoutInt8 extends LayoutType<Byte> {
|
||||
//ORIGINAL LINE: public override Result WriteSparse(ref RowBuffer b, ref RowCursor edit, sbyte value,
|
||||
// UpdateOptions options = UpdateOptions.Upsert)
|
||||
@Override
|
||||
public Result WriteSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit, byte value,
|
||||
public Result WriteSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, byte value,
|
||||
UpdateOptions options) {
|
||||
Result result = LayoutType.PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options);
|
||||
if (result != Result.Success) {
|
||||
@@ -82,7 +83,7 @@ public final class LayoutInt8 extends LayoutType<Byte> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result WriteSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit, byte value) {
|
||||
public Result WriteSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, byte value) {
|
||||
return WriteSparse(b, edit, value, UpdateOptions.Upsert);
|
||||
}
|
||||
}
|
||||
@@ -4,8 +4,9 @@
|
||||
|
||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
||||
|
||||
import com.azure.data.cosmos.core.OutObject;
|
||||
import com.azure.data.cosmos.core.RefObject;
|
||||
import com.azure.data.cosmos.core.Out;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.Result;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
||||
@@ -29,8 +30,8 @@ public final class LayoutMongoDbObjectId extends LayoutType<MongoDbObjectId> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result ReadFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
||||
OutObject<MongoDbObjectId> value) {
|
||||
public Result ReadFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col,
|
||||
Out<MongoDbObjectId> value) {
|
||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||
if (!b.get().ReadBit(scope.get().start, col.getNullBit().clone())) {
|
||||
value.set(null);
|
||||
@@ -42,8 +43,8 @@ public final class LayoutMongoDbObjectId extends LayoutType<MongoDbObjectId> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result ReadSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
||||
OutObject<MongoDbObjectId> value) {
|
||||
public Result ReadSparse(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||
Out<MongoDbObjectId> value) {
|
||||
Result result = LayoutType.PrepareSparseRead(b, edit, this.LayoutCode);
|
||||
if (result != Result.Success) {
|
||||
value.set(null);
|
||||
@@ -55,7 +56,7 @@ public final class LayoutMongoDbObjectId extends LayoutType<MongoDbObjectId> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result WriteFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
||||
public Result WriteFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col,
|
||||
MongoDbObjectId value) {
|
||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||
if (scope.get().immutable) {
|
||||
@@ -71,7 +72,7 @@ public final class LayoutMongoDbObjectId extends LayoutType<MongoDbObjectId> {
|
||||
//ORIGINAL LINE: public override Result WriteSparse(ref RowBuffer b, ref RowCursor edit, MongoDbObjectId value,
|
||||
// UpdateOptions options = UpdateOptions.Upsert)
|
||||
@Override
|
||||
public Result WriteSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
||||
public Result WriteSparse(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||
MongoDbObjectId value, UpdateOptions options) {
|
||||
Result result = LayoutType.PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options);
|
||||
if (result != Result.Success) {
|
||||
@@ -83,7 +84,7 @@ public final class LayoutMongoDbObjectId extends LayoutType<MongoDbObjectId> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result WriteSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
||||
public Result WriteSparse(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||
MongoDbObjectId value) {
|
||||
return WriteSparse(b, edit, value, UpdateOptions.Upsert);
|
||||
}
|
||||
|
||||
@@ -4,8 +4,9 @@
|
||||
|
||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
||||
|
||||
import com.azure.data.cosmos.core.OutObject;
|
||||
import com.azure.data.cosmos.core.RefObject;
|
||||
import com.azure.data.cosmos.core.Out;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.NullValue;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.Result;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||
@@ -34,8 +35,8 @@ public final class LayoutNull extends LayoutType<NullValue> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result ReadFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
||||
OutObject<NullValue> value) {
|
||||
public Result ReadFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col,
|
||||
Out<NullValue> value) {
|
||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||
value.set(NullValue.Default);
|
||||
if (!b.get().ReadBit(scope.get().start, col.getNullBit().clone())) {
|
||||
@@ -46,8 +47,8 @@ public final class LayoutNull extends LayoutType<NullValue> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result ReadSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
||||
OutObject<NullValue> value) {
|
||||
public Result ReadSparse(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||
Out<NullValue> value) {
|
||||
Result result = PrepareSparseRead(b, edit, this.LayoutCode);
|
||||
if (result != Result.Success) {
|
||||
value.set(null);
|
||||
@@ -59,7 +60,7 @@ public final class LayoutNull extends LayoutType<NullValue> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result WriteFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
||||
public Result WriteFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col,
|
||||
NullValue value) {
|
||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||
if (scope.get().immutable) {
|
||||
@@ -74,7 +75,7 @@ public final class LayoutNull extends LayoutType<NullValue> {
|
||||
//ORIGINAL LINE: public override Result WriteSparse(ref RowBuffer b, ref RowCursor edit, NullValue value,
|
||||
// UpdateOptions options = UpdateOptions.Upsert)
|
||||
@Override
|
||||
public Result WriteSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit, NullValue value,
|
||||
public Result WriteSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, NullValue value,
|
||||
UpdateOptions options) {
|
||||
Result result = PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options);
|
||||
if (result != Result.Success) {
|
||||
@@ -86,7 +87,7 @@ public final class LayoutNull extends LayoutType<NullValue> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result WriteSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit, NullValue value) {
|
||||
public Result WriteSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, NullValue value) {
|
||||
return WriteSparse(b, edit, value, UpdateOptions.Upsert);
|
||||
}
|
||||
}
|
||||
@@ -4,8 +4,9 @@
|
||||
|
||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
||||
|
||||
import com.azure.data.cosmos.core.OutObject;
|
||||
import com.azure.data.cosmos.core.RefObject;
|
||||
import com.azure.data.cosmos.core.Out;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.Result;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
||||
@@ -31,14 +32,14 @@ public final class LayoutNullable extends LayoutIndexedScope {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean HasImplicitTypeCode(RefObject<RowCursor> edit) {
|
||||
public boolean HasImplicitTypeCode(Reference<RowCursor> edit) {
|
||||
checkState(edit.get().index >= 0);
|
||||
checkState(edit.get().scopeTypeArgs.getCount() == 1);
|
||||
checkState(edit.get().index == 1);
|
||||
return !LayoutCodeTraits.AlwaysRequiresTypeCode(edit.get().scopeTypeArgs.get(0).getType().LayoutCode);
|
||||
}
|
||||
|
||||
public static Result HasValue(RefObject<RowBuffer> b, RefObject<RowCursor> scope) {
|
||||
public static Result HasValue(Reference<RowBuffer> b, Reference<RowCursor> scope) {
|
||||
checkArgument(scope.get().scopeType instanceof LayoutNullable);
|
||||
checkState(scope.get().index == 1 || scope.get().index == 2, "Nullable scopes always point at the value");
|
||||
checkState(scope.get().scopeTypeArgs.getCount() == 1);
|
||||
@@ -47,28 +48,28 @@ public final class LayoutNullable extends LayoutIndexedScope {
|
||||
}
|
||||
|
||||
@Override
|
||||
public TypeArgumentList ReadTypeArgumentList(RefObject<RowBuffer> row, int offset,
|
||||
OutObject<Integer> lenInBytes) {
|
||||
public TypeArgumentList ReadTypeArgumentList(Reference<RowBuffer> row, int offset,
|
||||
Out<Integer> lenInBytes) {
|
||||
return new TypeArgumentList(new TypeArgument[] { LayoutType.ReadTypeArgument(row, offset, lenInBytes) });
|
||||
}
|
||||
|
||||
@Override
|
||||
public void SetImplicitTypeCode(RefObject<RowCursor> edit) {
|
||||
public void SetImplicitTypeCode(Reference<RowCursor> edit) {
|
||||
checkState(edit.get().index == 1);
|
||||
edit.get().cellType = edit.get().scopeTypeArgs.get(0).getType();
|
||||
edit.get().cellTypeArgs = edit.get().scopeTypeArgs.get(0).getTypeArgs().clone();
|
||||
}
|
||||
|
||||
public Result WriteScope(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
||||
TypeArgumentList typeArgs, boolean hasValue, OutObject<RowCursor> value) {
|
||||
public Result WriteScope(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||
TypeArgumentList typeArgs, boolean hasValue, Out<RowCursor> value) {
|
||||
return WriteScope(b, edit, typeArgs, hasValue, value, UpdateOptions.Upsert);
|
||||
}
|
||||
|
||||
//C# TO JAVA CONVERTER NOTE: Java does not support optional parameters. Overloaded method(s) are created above:
|
||||
//ORIGINAL LINE: public Result WriteScope(ref RowBuffer b, ref RowCursor edit, TypeArgumentList typeArgs, bool
|
||||
// hasValue, out RowCursor value, UpdateOptions options = UpdateOptions.Upsert)
|
||||
public Result WriteScope(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
||||
TypeArgumentList typeArgs, boolean hasValue, OutObject<RowCursor> value,
|
||||
public Result WriteScope(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||
TypeArgumentList typeArgs, boolean hasValue, Out<RowCursor> value,
|
||||
UpdateOptions options) {
|
||||
Result result = LayoutType.PrepareSparseWrite(b, edit, new TypeArgument(this, typeArgs.clone()), options);
|
||||
if (result != Result.Success) {
|
||||
@@ -81,8 +82,8 @@ public final class LayoutNullable extends LayoutIndexedScope {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result WriteScope(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
||||
TypeArgumentList typeArgs, OutObject<RowCursor> value) {
|
||||
public Result WriteScope(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||
TypeArgumentList typeArgs, Out<RowCursor> value) {
|
||||
return WriteScope(b, edit, typeArgs, value, UpdateOptions.Upsert);
|
||||
}
|
||||
|
||||
@@ -90,13 +91,13 @@ public final class LayoutNullable extends LayoutIndexedScope {
|
||||
//ORIGINAL LINE: public override Result WriteScope(ref RowBuffer b, ref RowCursor edit, TypeArgumentList
|
||||
// typeArgs, out RowCursor value, UpdateOptions options = UpdateOptions.Upsert)
|
||||
@Override
|
||||
public Result WriteScope(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
||||
TypeArgumentList typeArgs, OutObject<RowCursor> value, UpdateOptions options) {
|
||||
public Result WriteScope(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||
TypeArgumentList typeArgs, Out<RowCursor> value, UpdateOptions options) {
|
||||
return this.WriteScope(b, edit, typeArgs.clone(), true, value, options);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int WriteTypeArgument(RefObject<RowBuffer> row, int offset, TypeArgumentList value) {
|
||||
public int WriteTypeArgument(Reference<RowBuffer> row, int offset, TypeArgumentList value) {
|
||||
checkState(value.getCount() == 1);
|
||||
row.get().WriteSparseTypeCode(offset, this.LayoutCode);
|
||||
int lenInBytes = (com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutCode.SIZE / Byte.SIZE);
|
||||
|
||||
@@ -4,8 +4,9 @@
|
||||
|
||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
||||
|
||||
import com.azure.data.cosmos.core.OutObject;
|
||||
import com.azure.data.cosmos.core.RefObject;
|
||||
import com.azure.data.cosmos.core.Out;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.Result;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
||||
@@ -30,8 +31,8 @@ public final class LayoutObject extends LayoutPropertyScope {
|
||||
|
||||
|
||||
@Override
|
||||
public Result WriteScope(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
||||
TypeArgumentList typeArgs, OutObject<RowCursor> value) {
|
||||
public Result WriteScope(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||
TypeArgumentList typeArgs, Out<RowCursor> value) {
|
||||
return WriteScope(b, edit, typeArgs, value, UpdateOptions.Upsert);
|
||||
}
|
||||
|
||||
@@ -39,8 +40,8 @@ public final class LayoutObject extends LayoutPropertyScope {
|
||||
//ORIGINAL LINE: public override Result WriteScope(ref RowBuffer b, ref RowCursor edit, TypeArgumentList
|
||||
// typeArgs, out RowCursor value, UpdateOptions options = UpdateOptions.Upsert)
|
||||
@Override
|
||||
public Result WriteScope(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
||||
TypeArgumentList typeArgs, OutObject<RowCursor> value, UpdateOptions options) {
|
||||
public Result WriteScope(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||
TypeArgumentList typeArgs, Out<RowCursor> value, UpdateOptions options) {
|
||||
Result result = LayoutType.PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options);
|
||||
if (result != Result.Success) {
|
||||
value.set(null);
|
||||
|
||||
@@ -12,12 +12,12 @@ import static com.google.common.base.Preconditions.checkState;
|
||||
import static com.google.common.base.Strings.lenientFormat;
|
||||
|
||||
/**
|
||||
* An implementation of <see cref="LayoutResolver" /> which dynamically compiles schema from
|
||||
* a <see cref="Namespace" />.
|
||||
* An implementation of {@link LayoutResolver} which dynamically compiles schema from
|
||||
* a {@link Namespace}.
|
||||
* <p>
|
||||
* <p>
|
||||
* This resolver assumes that <see cref="Schema" /> within the <see cref="Namespace" /> have
|
||||
* their <see cref="Schema.SchemaId" /> properly populated. The resolver caches compiled schema.
|
||||
* This resolver assumes that {@link Schema} within the {@link Namespace} have
|
||||
* their {@link Schema.SchemaId} properly populated. The resolver caches compiled schema.
|
||||
* <p>
|
||||
* All members of this class are multi-thread safe.
|
||||
*/
|
||||
@@ -49,7 +49,7 @@ public final class LayoutResolverNamespace extends LayoutResolver {
|
||||
// TODO: C# TO JAVA CONVERTER: There is no Java ConcurrentHashMap equivalent to this .NET
|
||||
// ConcurrentDictionary method:
|
||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
|
||||
// cannot be converted using the 'OutObject' helper class unless the method is within the code being modified:
|
||||
// cannot be converted using the 'Out' helper class unless the method is within the code being modified:
|
||||
if (this.layoutCache.TryGetValue(schemaId.getId(), out layout)) {
|
||||
return layout;
|
||||
}
|
||||
|
||||
@@ -4,8 +4,9 @@
|
||||
|
||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
||||
|
||||
import com.azure.data.cosmos.core.OutObject;
|
||||
import com.azure.data.cosmos.core.RefObject;
|
||||
import com.azure.data.cosmos.core.Out;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.Result;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
||||
@@ -51,7 +52,7 @@ public abstract class LayoutScope extends LayoutType {
|
||||
return false;
|
||||
}
|
||||
|
||||
public final Result DeleteScope(RefObject<RowBuffer> b, RefObject<RowCursor> edit) {
|
||||
public final Result DeleteScope(Reference<RowBuffer> b, Reference<RowCursor> edit) {
|
||||
Result result = LayoutType.PrepareSparseDelete(b, edit, this.LayoutCode);
|
||||
if (result != Result.Success) {
|
||||
return result;
|
||||
@@ -68,12 +69,12 @@ public abstract class LayoutScope extends LayoutType {
|
||||
* @param edit
|
||||
* @return True if the type code is implied (not written), false otherwise.
|
||||
*/
|
||||
public boolean HasImplicitTypeCode(RefObject<RowCursor> edit) {
|
||||
public boolean HasImplicitTypeCode(Reference<RowCursor> edit) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public final Result ReadScope(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
||||
OutObject<RowCursor> value) {
|
||||
public final Result ReadScope(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||
Out<RowCursor> value) {
|
||||
Result result = LayoutType.PrepareSparseRead(b, edit, this.LayoutCode);
|
||||
if (result != Result.Success) {
|
||||
value.set(null);
|
||||
@@ -85,32 +86,32 @@ public abstract class LayoutScope extends LayoutType {
|
||||
return Result.Success;
|
||||
}
|
||||
|
||||
public void ReadSparsePath(RefObject<RowBuffer> row, RefObject<RowCursor> edit) {
|
||||
public void ReadSparsePath(Reference<RowBuffer> row, Reference<RowCursor> edit) {
|
||||
int pathLenInBytes;
|
||||
OutObject<Integer> tempOut_pathLenInBytes = new OutObject<Integer>();
|
||||
OutObject<Integer> tempOut_pathOffset = new OutObject<Integer>();
|
||||
Out<Integer> tempOut_pathLenInBytes = new Out<Integer>();
|
||||
Out<Integer> tempOut_pathOffset = new Out<Integer>();
|
||||
edit.get().pathToken = row.get().ReadSparsePathLen(edit.get().layout, edit.get().valueOffset, tempOut_pathLenInBytes, tempOut_pathOffset);
|
||||
edit.get().argValue.pathOffset = tempOut_pathOffset.get();
|
||||
pathLenInBytes = tempOut_pathLenInBytes.get();
|
||||
edit.get().valueOffset += pathLenInBytes;
|
||||
}
|
||||
|
||||
public void SetImplicitTypeCode(RefObject<RowCursor> edit) {
|
||||
public void SetImplicitTypeCode(Reference<RowCursor> edit) {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public abstract Result WriteScope(
|
||||
RefObject<RowBuffer> b, RefObject<RowCursor> scope, TypeArgumentList typeArgs,
|
||||
OutObject<RowCursor> value);
|
||||
Reference<RowBuffer> b, Reference<RowCursor> scope, TypeArgumentList typeArgs,
|
||||
Out<RowCursor> value);
|
||||
|
||||
//C# TO JAVA CONVERTER NOTE: Java does not support optional parameters. Overloaded method(s) are created above:
|
||||
//ORIGINAL LINE: public abstract Result WriteScope(ref RowBuffer b, ref RowCursor scope, TypeArgumentList
|
||||
// typeArgs, out RowCursor value, UpdateOptions options = UpdateOptions.Upsert);
|
||||
public abstract Result WriteScope(RefObject<RowBuffer> b, RefObject<RowCursor> scope,
|
||||
TypeArgumentList typeArgs, OutObject<RowCursor> value,
|
||||
public abstract Result WriteScope(Reference<RowBuffer> b, Reference<RowCursor> scope,
|
||||
TypeArgumentList typeArgs, Out<RowCursor> value,
|
||||
UpdateOptions options);
|
||||
|
||||
public <TContext> Result WriteScope(RefObject<RowBuffer> b, RefObject<RowCursor> scope,
|
||||
public <TContext> Result WriteScope(Reference<RowBuffer> b, Reference<RowCursor> scope,
|
||||
TypeArgumentList typeArgs, TContext context, WriterFunc<TContext> func) {
|
||||
return WriteScope(b, scope, typeArgs, context, func, UpdateOptions.Upsert);
|
||||
}
|
||||
@@ -119,37 +120,37 @@ public abstract class LayoutScope extends LayoutType {
|
||||
//ORIGINAL LINE: public virtual Result WriteScope<TContext>(ref RowBuffer b, ref RowCursor scope,
|
||||
// TypeArgumentList typeArgs, TContext context, WriterFunc<TContext> func, UpdateOptions options = UpdateOptions
|
||||
// .Upsert)
|
||||
public <TContext> Result WriteScope(RefObject<RowBuffer> b, RefObject<RowCursor> scope,
|
||||
public <TContext> Result WriteScope(Reference<RowBuffer> b, Reference<RowCursor> scope,
|
||||
TypeArgumentList typeArgs, TContext context, WriterFunc<TContext> func,
|
||||
UpdateOptions options) {
|
||||
RowCursor childScope;
|
||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
|
||||
// cannot be converted using the 'OutObject' helper class unless the method is within the code being modified:
|
||||
// cannot be converted using the 'Out' helper class unless the method is within the code being modified:
|
||||
Result r = this.WriteScope(b, scope, typeArgs.clone(), out childScope, options);
|
||||
if (r != Result.Success) {
|
||||
return r;
|
||||
}
|
||||
|
||||
RefObject<RowCursor> tempRef_childScope =
|
||||
new RefObject<RowCursor>(childScope);
|
||||
Reference<RowCursor> tempReference_childScope =
|
||||
new Reference<RowCursor>(childScope);
|
||||
// TODO: C# TO JAVA CONVERTER: The following line could not be converted:
|
||||
r = func == null ? null : func.Invoke(ref b, ref childScope, context) ??Result.Success;
|
||||
childScope = tempRef_childScope.get();
|
||||
childScope = tempReference_childScope.get();
|
||||
if (r != Result.Success) {
|
||||
this.DeleteScope(b, scope);
|
||||
return r;
|
||||
}
|
||||
|
||||
RefObject<RowCursor> tempRef_childScope2 =
|
||||
new RefObject<RowCursor>(childScope);
|
||||
Reference<RowCursor> tempReference_childScope2 =
|
||||
new Reference<RowCursor>(childScope);
|
||||
RowCursorExtensions.Skip(scope.get().clone(), b,
|
||||
tempRef_childScope2);
|
||||
childScope = tempRef_childScope2.get();
|
||||
tempReference_childScope2);
|
||||
childScope = tempReference_childScope2.get();
|
||||
return Result.Success;
|
||||
}
|
||||
|
||||
/**
|
||||
* A function to write content into a <see cref="RowBuffer" />.
|
||||
* A function to write content into a {@link RowBuffer}.
|
||||
* <typeparam name="TContext">The type of the context value passed by the caller.</typeparam>
|
||||
*
|
||||
* @param b The row to write to.
|
||||
@@ -159,6 +160,6 @@ public abstract class LayoutScope extends LayoutType {
|
||||
*/
|
||||
@FunctionalInterface
|
||||
public interface WriterFunc<TContext> {
|
||||
Result invoke(RefObject<RowBuffer> b, RefObject<RowCursor> scope, TContext context);
|
||||
Result invoke(Reference<RowBuffer> b, Reference<RowCursor> scope, TContext context);
|
||||
}
|
||||
}
|
||||
@@ -4,8 +4,9 @@
|
||||
|
||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
||||
|
||||
import com.azure.data.cosmos.core.OutObject;
|
||||
import com.azure.data.cosmos.core.RefObject;
|
||||
import com.azure.data.cosmos.core.Out;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.Result;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
||||
@@ -30,15 +31,15 @@ public final class LayoutTagged extends LayoutIndexedScope {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean HasImplicitTypeCode(RefObject<RowCursor> edit) {
|
||||
public boolean HasImplicitTypeCode(Reference<RowCursor> edit) {
|
||||
checkArgument(edit.get().index >= 0);
|
||||
checkArgument(edit.get().scopeTypeArgs.getCount() > edit.get().index);
|
||||
return !LayoutCodeTraits.AlwaysRequiresTypeCode(edit.get().scopeTypeArgs.get(edit.get().index).getType().LayoutCode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TypeArgumentList ReadTypeArgumentList(RefObject<RowBuffer> row, int offset,
|
||||
OutObject<Integer> lenInBytes) {
|
||||
public TypeArgumentList ReadTypeArgumentList(Reference<RowBuffer> row, int offset,
|
||||
Out<Integer> lenInBytes) {
|
||||
TypeArgument[] retval = new TypeArgument[2];
|
||||
retval[0] = new TypeArgument(UInt8, TypeArgumentList.Empty);
|
||||
retval[1] = ReadTypeArgument(row, offset, lenInBytes);
|
||||
@@ -46,14 +47,14 @@ public final class LayoutTagged extends LayoutIndexedScope {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void SetImplicitTypeCode(RefObject<RowCursor> edit) {
|
||||
public void SetImplicitTypeCode(Reference<RowCursor> edit) {
|
||||
edit.get().cellType = edit.get().scopeTypeArgs.get(edit.get().index).getType();
|
||||
edit.get().cellTypeArgs = edit.get().scopeTypeArgs.get(edit.get().index).getTypeArgs().clone();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result WriteScope(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
||||
TypeArgumentList typeArgs, OutObject<RowCursor> value) {
|
||||
public Result WriteScope(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||
TypeArgumentList typeArgs, Out<RowCursor> value) {
|
||||
return WriteScope(b, edit, typeArgs, value, UpdateOptions.Upsert);
|
||||
}
|
||||
|
||||
@@ -61,8 +62,8 @@ public final class LayoutTagged extends LayoutIndexedScope {
|
||||
//ORIGINAL LINE: public override Result WriteScope(ref RowBuffer b, ref RowCursor edit, TypeArgumentList
|
||||
// typeArgs, out RowCursor value, UpdateOptions options = UpdateOptions.Upsert)
|
||||
@Override
|
||||
public Result WriteScope(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
||||
TypeArgumentList typeArgs, OutObject<RowCursor> value, UpdateOptions options) {
|
||||
public Result WriteScope(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||
TypeArgumentList typeArgs, Out<RowCursor> value, UpdateOptions options) {
|
||||
Result result = PrepareSparseWrite(b, edit, new TypeArgument(this, typeArgs.clone()), options);
|
||||
if (result != Result.Success) {
|
||||
value.set(null);
|
||||
@@ -74,7 +75,7 @@ public final class LayoutTagged extends LayoutIndexedScope {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int WriteTypeArgument(RefObject<RowBuffer> row, int offset, TypeArgumentList value) {
|
||||
public int WriteTypeArgument(Reference<RowBuffer> row, int offset, TypeArgumentList value) {
|
||||
checkArgument(value.getCount() == 2);
|
||||
row.get().WriteSparseTypeCode(offset, this.LayoutCode);
|
||||
int lenInBytes = (com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutCode.SIZE / Byte.SIZE);
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
|
||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
||||
|
||||
import com.azure.data.cosmos.core.OutObject;
|
||||
import com.azure.data.cosmos.core.RefObject;
|
||||
import com.azure.data.cosmos.core.Out;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.Result;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
||||
@@ -35,21 +35,21 @@ public final class LayoutTagged2 extends LayoutIndexedScope {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean HasImplicitTypeCode(RefObject<RowCursor> edit) {
|
||||
public boolean HasImplicitTypeCode(Reference<RowCursor> edit) {
|
||||
checkState(edit.get().index >= 0);
|
||||
checkState(edit.get().scopeTypeArgs.getCount() > edit.get().index);
|
||||
return !LayoutCodeTraits.AlwaysRequiresTypeCode(edit.get().scopeTypeArgs.get(edit.get().index).getType().LayoutCode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TypeArgumentList ReadTypeArgumentList(RefObject<RowBuffer> row, int offset,
|
||||
OutObject<Integer> lenInBytes) {
|
||||
public TypeArgumentList ReadTypeArgumentList(Reference<RowBuffer> row, int offset,
|
||||
Out<Integer> lenInBytes) {
|
||||
lenInBytes.set(0);
|
||||
TypeArgument[] retval = new TypeArgument[3];
|
||||
retval[0] = new TypeArgument(UInt8, TypeArgumentList.Empty);
|
||||
for (int i = 1; i < 3; i++) {
|
||||
int itemLenInBytes;
|
||||
OutObject<Integer> tempOut_itemLenInBytes = new OutObject<Integer>();
|
||||
Out<Integer> tempOut_itemLenInBytes = new Out<Integer>();
|
||||
retval[i] = ReadTypeArgument(row, offset + lenInBytes.get(), tempOut_itemLenInBytes);
|
||||
itemLenInBytes = tempOut_itemLenInBytes.get();
|
||||
lenInBytes.set(lenInBytes.get() + itemLenInBytes);
|
||||
@@ -59,14 +59,14 @@ public final class LayoutTagged2 extends LayoutIndexedScope {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void SetImplicitTypeCode(RefObject<RowCursor> edit) {
|
||||
public void SetImplicitTypeCode(Reference<RowCursor> edit) {
|
||||
edit.get().cellType = edit.get().scopeTypeArgs.get(edit.get().index).getType();
|
||||
edit.get().cellTypeArgs = edit.get().scopeTypeArgs.get(edit.get().index).getTypeArgs().clone();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result WriteScope(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
||||
TypeArgumentList typeArgs, OutObject<RowCursor> value) {
|
||||
public Result WriteScope(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||
TypeArgumentList typeArgs, Out<RowCursor> value) {
|
||||
return WriteScope(b, edit, typeArgs, value, UpdateOptions.Upsert);
|
||||
}
|
||||
|
||||
@@ -74,8 +74,8 @@ public final class LayoutTagged2 extends LayoutIndexedScope {
|
||||
//ORIGINAL LINE: public override Result WriteScope(ref RowBuffer b, ref RowCursor edit, TypeArgumentList
|
||||
// typeArgs, out RowCursor value, UpdateOptions options = UpdateOptions.Upsert)
|
||||
@Override
|
||||
public Result WriteScope(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
||||
TypeArgumentList typeArgs, OutObject<RowCursor> value, UpdateOptions options) {
|
||||
public Result WriteScope(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||
TypeArgumentList typeArgs, Out<RowCursor> value, UpdateOptions options) {
|
||||
Result result = PrepareSparseWrite(b, edit, new TypeArgument(this, typeArgs.clone()), options);
|
||||
if (result != Result.Success) {
|
||||
value.set(null);
|
||||
@@ -87,7 +87,7 @@ public final class LayoutTagged2 extends LayoutIndexedScope {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int WriteTypeArgument(RefObject<RowBuffer> row, int offset, TypeArgumentList value) {
|
||||
public int WriteTypeArgument(Reference<RowBuffer> row, int offset, TypeArgumentList value) {
|
||||
checkState(value.getCount() == 3);
|
||||
row.get().WriteSparseTypeCode(offset, this.LayoutCode);
|
||||
int lenInBytes = (com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutCode.SIZE / Byte.SIZE);
|
||||
|
||||
@@ -4,8 +4,9 @@
|
||||
|
||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
||||
|
||||
import com.azure.data.cosmos.core.OutObject;
|
||||
import com.azure.data.cosmos.core.RefObject;
|
||||
import com.azure.data.cosmos.core.Out;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.Result;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
||||
@@ -37,13 +38,13 @@ public final class LayoutTuple extends LayoutIndexedScope {
|
||||
}
|
||||
|
||||
@Override
|
||||
public TypeArgumentList ReadTypeArgumentList(RefObject<RowBuffer> row, int offset,
|
||||
OutObject<Integer> lenInBytes) {
|
||||
public TypeArgumentList ReadTypeArgumentList(Reference<RowBuffer> row, int offset,
|
||||
Out<Integer> lenInBytes) {
|
||||
int numTypeArgs = row.get().intValue().Read7BitEncodedUInt(offset, lenInBytes);
|
||||
TypeArgument[] retval = new TypeArgument[numTypeArgs];
|
||||
for (int i = 0; i < numTypeArgs; i++) {
|
||||
int itemLenInBytes;
|
||||
OutObject<Integer> tempOut_itemLenInBytes = new OutObject<Integer>();
|
||||
Out<Integer> tempOut_itemLenInBytes = new Out<Integer>();
|
||||
retval[i] = ReadTypeArgument(row, offset + lenInBytes.get(), tempOut_itemLenInBytes);
|
||||
itemLenInBytes = tempOut_itemLenInBytes.get();
|
||||
lenInBytes.set(lenInBytes.get() + itemLenInBytes);
|
||||
@@ -53,8 +54,8 @@ public final class LayoutTuple extends LayoutIndexedScope {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result WriteScope(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
||||
TypeArgumentList typeArgs, OutObject<RowCursor> value) {
|
||||
public Result WriteScope(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||
TypeArgumentList typeArgs, Out<RowCursor> value) {
|
||||
return WriteScope(b, edit, typeArgs, value, UpdateOptions.Upsert);
|
||||
}
|
||||
|
||||
@@ -62,8 +63,8 @@ public final class LayoutTuple extends LayoutIndexedScope {
|
||||
//ORIGINAL LINE: public override Result WriteScope(ref RowBuffer b, ref RowCursor edit, TypeArgumentList
|
||||
// typeArgs, out RowCursor value, UpdateOptions options = UpdateOptions.Upsert)
|
||||
@Override
|
||||
public Result WriteScope(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
||||
TypeArgumentList typeArgs, OutObject<RowCursor> value, UpdateOptions options) {
|
||||
public Result WriteScope(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||
TypeArgumentList typeArgs, Out<RowCursor> value, UpdateOptions options) {
|
||||
Result result = PrepareSparseWrite(b, edit, new TypeArgument(this, typeArgs.clone()), options);
|
||||
if (result != Result.Success) {
|
||||
value.set(null);
|
||||
@@ -75,7 +76,7 @@ public final class LayoutTuple extends LayoutIndexedScope {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int WriteTypeArgument(RefObject<RowBuffer> row, int offset, TypeArgumentList value) {
|
||||
public int WriteTypeArgument(Reference<RowBuffer> row, int offset, TypeArgumentList value) {
|
||||
row.get().WriteSparseTypeCode(offset, this.LayoutCode);
|
||||
int lenInBytes = (com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutCode.SIZE / Byte.SIZE);
|
||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||
|
||||
@@ -4,8 +4,9 @@
|
||||
|
||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
||||
|
||||
import com.azure.data.cosmos.core.OutObject;
|
||||
import com.azure.data.cosmos.core.RefObject;
|
||||
import com.azure.data.cosmos.core.Out;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.Result;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
||||
@@ -27,7 +28,7 @@ import static com.google.common.base.Strings.lenientFormat;
|
||||
|
||||
/**
|
||||
* The abstract base class for typed hybrid row field descriptors.
|
||||
* <see cref="LayoutType" /> is immutable.
|
||||
* {@link LayoutType} is immutable.
|
||||
*/
|
||||
// TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes:
|
||||
//ORIGINAL LINE: [DebuggerDisplay("{" + nameof(LayoutType.Name) + "}")] public abstract class LayoutType : ILayoutType
|
||||
@@ -269,7 +270,7 @@ public abstract class LayoutType implements ILayoutType {
|
||||
public int Size;
|
||||
|
||||
/**
|
||||
* Initializes a new instance of the <see cref="LayoutType" /> class.
|
||||
* Initializes a new instance of the {@link LayoutType} class.
|
||||
*/
|
||||
public LayoutType(LayoutCode code, boolean immutable, int size) {
|
||||
this.LayoutCode = code;
|
||||
@@ -343,7 +344,7 @@ public abstract class LayoutType implements ILayoutType {
|
||||
* @param code The expected type of the field.
|
||||
* @return Success if the delete is permitted, the error code otherwise.
|
||||
*/
|
||||
public static Result PrepareSparseDelete(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
||||
public static Result PrepareSparseDelete(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||
LayoutCode code) {
|
||||
if (edit.get().scopeType.IsFixedArity) {
|
||||
return Result.TypeConstraint;
|
||||
@@ -373,11 +374,11 @@ public abstract class LayoutType implements ILayoutType {
|
||||
* @return Success if the move is permitted, the error code otherwise.
|
||||
* The source field is delete if the move prepare fails with a destination error.
|
||||
*/
|
||||
public static Result PrepareSparseMove(RefObject<RowBuffer> b,
|
||||
RefObject<RowCursor> destinationScope,
|
||||
public static Result PrepareSparseMove(Reference<RowBuffer> b,
|
||||
Reference<RowCursor> destinationScope,
|
||||
LayoutScope destinationCode, TypeArgument elementType,
|
||||
RefObject<RowCursor> srcEdit, UpdateOptions options,
|
||||
OutObject<RowCursor> dstEdit) {
|
||||
Reference<RowCursor> srcEdit, UpdateOptions options,
|
||||
Out<RowCursor> dstEdit) {
|
||||
checkArgument(destinationScope.get().scopeType == destinationCode);
|
||||
checkArgument(destinationScope.get().index == 0, "Can only insert into a edit at the root");
|
||||
|
||||
@@ -436,7 +437,7 @@ public abstract class LayoutType implements ILayoutType {
|
||||
* @param code The expected type of the field.
|
||||
* @return Success if the read is permitted, the error code otherwise.
|
||||
*/
|
||||
public static Result PrepareSparseRead(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
||||
public static Result PrepareSparseRead(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||
LayoutCode code) {
|
||||
if (!edit.get().exists) {
|
||||
return Result.NotFound;
|
||||
@@ -458,7 +459,7 @@ public abstract class LayoutType implements ILayoutType {
|
||||
* @param options The write options.
|
||||
* @return Success if the write is permitted, the error code otherwise.
|
||||
*/
|
||||
public static Result PrepareSparseWrite(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
||||
public static Result PrepareSparseWrite(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||
TypeArgument typeArg, UpdateOptions options) {
|
||||
if (edit.get().immutable || (edit.get().scopeType.IsUniqueScope && !edit.get().deferUniqueIndex)) {
|
||||
return Result.InsufficientPermissions;
|
||||
@@ -497,17 +498,17 @@ public abstract class LayoutType implements ILayoutType {
|
||||
|
||||
// TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes:
|
||||
//ORIGINAL LINE: [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static TypeArgument ReadTypeArgument(ref RowBuffer row, int offset, out int lenInBytes)
|
||||
public static TypeArgument ReadTypeArgument(RefObject<RowBuffer> row, int offset, OutObject<Integer> lenInBytes) {
|
||||
public static TypeArgument ReadTypeArgument(Reference<RowBuffer> row, int offset, Out<Integer> lenInBytes) {
|
||||
LayoutType itemCode = row.get().ReadSparseTypeCode(offset);
|
||||
int argsLenInBytes;
|
||||
OutObject<Integer> tempOut_argsLenInBytes = new OutObject<Integer>();
|
||||
Out<Integer> tempOut_argsLenInBytes = new Out<Integer>();
|
||||
TypeArgumentList itemTypeArgs = itemCode.ReadTypeArgumentList(row, offset + (com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutCode.SIZE / Byte.SIZE), tempOut_argsLenInBytes).clone();
|
||||
argsLenInBytes = tempOut_argsLenInBytes.get();
|
||||
lenInBytes.set((com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutCode.SIZE / Byte.SIZE) + argsLenInBytes);
|
||||
return new TypeArgument(itemCode, itemTypeArgs.clone());
|
||||
}
|
||||
|
||||
public TypeArgumentList ReadTypeArgumentList(RefObject<RowBuffer> row, int offset, OutObject<Integer> lenInBytes) {
|
||||
public TypeArgumentList ReadTypeArgumentList(Reference<RowBuffer> row, int offset, Out<Integer> lenInBytes) {
|
||||
lenInBytes.set(0);
|
||||
return TypeArgumentList.Empty;
|
||||
}
|
||||
@@ -521,7 +522,7 @@ public abstract class LayoutType implements ILayoutType {
|
||||
return (T)this;
|
||||
}
|
||||
|
||||
public int WriteTypeArgument(RefObject<RowBuffer> row, int offset, TypeArgumentList value) {
|
||||
public int WriteTypeArgument(Reference<RowBuffer> row, int offset, TypeArgumentList value) {
|
||||
row.get().WriteSparseTypeCode(offset, this.LayoutCode);
|
||||
return (com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutCode.SIZE / Byte.SIZE);
|
||||
}
|
||||
|
||||
@@ -4,8 +4,9 @@
|
||||
|
||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
||||
|
||||
import com.azure.data.cosmos.core.OutObject;
|
||||
import com.azure.data.cosmos.core.RefObject;
|
||||
import com.azure.data.cosmos.core.Out;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.Result;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
||||
@@ -17,11 +18,11 @@ import static com.google.common.base.Preconditions.checkArgument;
|
||||
* <typeparamref name="T" />.
|
||||
*
|
||||
*
|
||||
* <see cref="LayoutType{T}" /> is an immutable, stateless, helper class. It provides
|
||||
* {@link LayoutType{T}} is an immutable, stateless, helper class. It provides
|
||||
* methods for manipulating hybrid row fields of a particular type, and properties that describe the
|
||||
* layout of fields of that type.
|
||||
* <para />
|
||||
* <see cref="LayoutType{T}" /> is immutable.
|
||||
* {@link LayoutType{T}} is immutable.
|
||||
*/
|
||||
public abstract class LayoutType<T> extends LayoutType {
|
||||
private TypeArgument typeArg = new TypeArgument();
|
||||
@@ -31,7 +32,7 @@ public abstract class LayoutType<T> extends LayoutType {
|
||||
this.typeArg = new TypeArgument(this);
|
||||
}
|
||||
|
||||
public final Result DeleteFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope,
|
||||
public final Result DeleteFixed(Reference<RowBuffer> b, Reference<RowCursor> scope,
|
||||
LayoutColumn col) {
|
||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||
if (scope.get().immutable) {
|
||||
@@ -53,7 +54,7 @@ public abstract class LayoutType<T> extends LayoutType {
|
||||
* If a value exists, then it is removed. The remainder of the row is resized to accomodate
|
||||
* a decrease in required space. If no value exists this operation is a no-op.
|
||||
*/
|
||||
public final Result DeleteSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit) {
|
||||
public final Result DeleteSparse(Reference<RowBuffer> b, Reference<RowCursor> edit) {
|
||||
Result result = LayoutType.PrepareSparseDelete(b, edit, this.LayoutCode);
|
||||
if (result != Result.Success) {
|
||||
return result;
|
||||
@@ -69,7 +70,7 @@ public abstract class LayoutType<T> extends LayoutType {
|
||||
* If a value exists, then it is removed. The remainder of the row is resized to accomodate
|
||||
* a decrease in required space. If no value exists this operation is a no-op.
|
||||
*/
|
||||
public final Result DeleteVariable(RefObject<RowBuffer> b, RefObject<RowCursor> scope,
|
||||
public final Result DeleteVariable(Reference<RowBuffer> b, Reference<RowCursor> scope,
|
||||
LayoutColumn col) {
|
||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||
if (scope.get().immutable) {
|
||||
@@ -87,7 +88,7 @@ public abstract class LayoutType<T> extends LayoutType {
|
||||
return Result.Success;
|
||||
}
|
||||
|
||||
public final Result HasValue(RefObject<RowBuffer> b, RefObject<RowCursor> scope,
|
||||
public final Result HasValue(Reference<RowBuffer> b, Reference<RowCursor> scope,
|
||||
LayoutColumn col) {
|
||||
if (!b.get().ReadBit(scope.get().start, col.getNullBit().clone())) {
|
||||
return Result.NotFound;
|
||||
@@ -96,28 +97,28 @@ public abstract class LayoutType<T> extends LayoutType {
|
||||
return Result.Success;
|
||||
}
|
||||
|
||||
public abstract Result ReadFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope,
|
||||
LayoutColumn col, OutObject<T> value);
|
||||
public abstract Result ReadFixed(Reference<RowBuffer> b, Reference<RowCursor> scope,
|
||||
LayoutColumn col, Out<T> value);
|
||||
|
||||
public abstract Result ReadSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit, OutObject<T> value);
|
||||
public abstract Result ReadSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, Out<T> value);
|
||||
|
||||
public Result ReadVariable(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col
|
||||
, OutObject<T> value) {
|
||||
public Result ReadVariable(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col
|
||||
, Out<T> value) {
|
||||
value.set(null);
|
||||
return Result.Failure;
|
||||
}
|
||||
|
||||
public abstract Result WriteFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope,
|
||||
public abstract Result WriteFixed(Reference<RowBuffer> b, Reference<RowCursor> scope,
|
||||
LayoutColumn col, T value);
|
||||
|
||||
public abstract Result WriteSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit, T value);
|
||||
public abstract Result WriteSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, T value);
|
||||
|
||||
//C# TO JAVA CONVERTER NOTE: Java does not support optional parameters. Overloaded method(s) are created above:
|
||||
//ORIGINAL LINE: public abstract Result WriteSparse(ref RowBuffer b, ref RowCursor edit, T value, UpdateOptions
|
||||
// options = UpdateOptions.Upsert);
|
||||
public abstract Result WriteSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit, T value, UpdateOptions options);
|
||||
public abstract Result WriteSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, T value, UpdateOptions options);
|
||||
|
||||
public Result WriteVariable(RefObject<RowBuffer> b, RefObject<RowCursor> scope,
|
||||
public Result WriteVariable(Reference<RowBuffer> b, Reference<RowCursor> scope,
|
||||
LayoutColumn col, T value) {
|
||||
return Result.Failure;
|
||||
}
|
||||
|
||||
@@ -4,8 +4,9 @@
|
||||
|
||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
||||
|
||||
import com.azure.data.cosmos.core.OutObject;
|
||||
import com.azure.data.cosmos.core.RefObject;
|
||||
import com.azure.data.cosmos.core.Out;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.Result;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
||||
@@ -28,27 +29,27 @@ public final class LayoutTypedArray extends LayoutIndexedScope {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean HasImplicitTypeCode(RefObject<RowCursor> edit) {
|
||||
public boolean HasImplicitTypeCode(Reference<RowCursor> edit) {
|
||||
checkState(edit.get().index >= 0);
|
||||
checkState(edit.get().scopeTypeArgs.getCount() == 1);
|
||||
return !LayoutCodeTraits.AlwaysRequiresTypeCode(edit.get().scopeTypeArgs.get(0).getType().LayoutCode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TypeArgumentList ReadTypeArgumentList(RefObject<RowBuffer> row, int offset,
|
||||
OutObject<Integer> lenInBytes) {
|
||||
public TypeArgumentList ReadTypeArgumentList(Reference<RowBuffer> row, int offset,
|
||||
Out<Integer> lenInBytes) {
|
||||
return new TypeArgumentList(new TypeArgument[] { LayoutType.ReadTypeArgument(row, offset, lenInBytes) });
|
||||
}
|
||||
|
||||
@Override
|
||||
public void SetImplicitTypeCode(RefObject<RowCursor> edit) {
|
||||
public void SetImplicitTypeCode(Reference<RowCursor> edit) {
|
||||
edit.get().cellType = edit.get().scopeTypeArgs.get(0).getType();
|
||||
edit.get().cellTypeArgs = edit.get().scopeTypeArgs.get(0).getTypeArgs().clone();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result WriteScope(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
||||
TypeArgumentList typeArgs, OutObject<RowCursor> value) {
|
||||
public Result WriteScope(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||
TypeArgumentList typeArgs, Out<RowCursor> value) {
|
||||
return WriteScope(b, edit, typeArgs, value, UpdateOptions.Upsert);
|
||||
}
|
||||
|
||||
@@ -56,8 +57,8 @@ public final class LayoutTypedArray extends LayoutIndexedScope {
|
||||
//ORIGINAL LINE: public override Result WriteScope(ref RowBuffer b, ref RowCursor edit, TypeArgumentList
|
||||
// typeArgs, out RowCursor value, UpdateOptions options = UpdateOptions.Upsert)
|
||||
@Override
|
||||
public Result WriteScope(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
||||
TypeArgumentList typeArgs, OutObject<RowCursor> value, UpdateOptions options) {
|
||||
public Result WriteScope(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||
TypeArgumentList typeArgs, Out<RowCursor> value, UpdateOptions options) {
|
||||
Result result = LayoutType.PrepareSparseWrite(b, edit, new TypeArgument(this, typeArgs.clone()), options);
|
||||
if (result != Result.Success) {
|
||||
value.set(null);
|
||||
@@ -69,7 +70,7 @@ public final class LayoutTypedArray extends LayoutIndexedScope {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int WriteTypeArgument(RefObject<RowBuffer> row, int offset, TypeArgumentList value) {
|
||||
public int WriteTypeArgument(Reference<RowBuffer> row, int offset, TypeArgumentList value) {
|
||||
checkState(value.getCount() == 1);
|
||||
row.get().WriteSparseTypeCode(offset, this.LayoutCode);
|
||||
int lenInBytes = (com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutCode.SIZE / Byte.SIZE);
|
||||
|
||||
@@ -4,8 +4,9 @@
|
||||
|
||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
||||
|
||||
import com.azure.data.cosmos.core.OutObject;
|
||||
import com.azure.data.cosmos.core.RefObject;
|
||||
import com.azure.data.cosmos.core.Out;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.Result;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
||||
@@ -34,24 +35,24 @@ public final class LayoutTypedMap extends LayoutUniqueScope {
|
||||
}
|
||||
|
||||
@Override
|
||||
public TypeArgument FieldType(RefObject<RowCursor> scope) {
|
||||
public TypeArgument FieldType(Reference<RowCursor> scope) {
|
||||
return new TypeArgument(scope.get().scopeType.Immutable ? ImmutableTypedTuple :
|
||||
TypedTuple, scope.get().scopeTypeArgs.clone());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean HasImplicitTypeCode(RefObject<RowCursor> edit) {
|
||||
public boolean HasImplicitTypeCode(Reference<RowCursor> edit) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TypeArgumentList ReadTypeArgumentList(RefObject<RowBuffer> row, int offset,
|
||||
OutObject<Integer> lenInBytes) {
|
||||
public TypeArgumentList ReadTypeArgumentList(Reference<RowBuffer> row, int offset,
|
||||
Out<Integer> lenInBytes) {
|
||||
lenInBytes.set(0);
|
||||
TypeArgument[] retval = new TypeArgument[2];
|
||||
for (int i = 0; i < 2; i++) {
|
||||
int itemLenInBytes;
|
||||
OutObject<Integer> tempOut_itemLenInBytes = new OutObject<Integer>();
|
||||
Out<Integer> tempOut_itemLenInBytes = new Out<Integer>();
|
||||
retval[i] = ReadTypeArgument(row, offset + lenInBytes.get(), tempOut_itemLenInBytes);
|
||||
itemLenInBytes = tempOut_itemLenInBytes.get();
|
||||
lenInBytes.set(lenInBytes.get() + itemLenInBytes);
|
||||
@@ -61,15 +62,15 @@ public final class LayoutTypedMap extends LayoutUniqueScope {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void SetImplicitTypeCode(RefObject<RowCursor> edit) {
|
||||
public void SetImplicitTypeCode(Reference<RowCursor> edit) {
|
||||
edit.get().cellType = edit.get().scopeType.Immutable ? ImmutableTypedTuple :
|
||||
TypedTuple;
|
||||
edit.get().cellTypeArgs = edit.get().scopeTypeArgs.clone();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result WriteScope(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
||||
TypeArgumentList typeArgs, OutObject<RowCursor> value) {
|
||||
public Result WriteScope(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||
TypeArgumentList typeArgs, Out<RowCursor> value) {
|
||||
return WriteScope(b, edit, typeArgs, value, UpdateOptions.Upsert);
|
||||
}
|
||||
|
||||
@@ -77,8 +78,8 @@ public final class LayoutTypedMap extends LayoutUniqueScope {
|
||||
//ORIGINAL LINE: public override Result WriteScope(ref RowBuffer b, ref RowCursor edit, TypeArgumentList
|
||||
// typeArgs, out RowCursor value, UpdateOptions options = UpdateOptions.Upsert)
|
||||
@Override
|
||||
public Result WriteScope(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
||||
TypeArgumentList typeArgs, OutObject<RowCursor> value, UpdateOptions options) {
|
||||
public Result WriteScope(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||
TypeArgumentList typeArgs, Out<RowCursor> value, UpdateOptions options) {
|
||||
Result result = PrepareSparseWrite(b, edit, new TypeArgument(this, typeArgs.clone()), options);
|
||||
if (result != Result.Success) {
|
||||
value.set(null);
|
||||
@@ -90,7 +91,7 @@ public final class LayoutTypedMap extends LayoutUniqueScope {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int WriteTypeArgument(RefObject<RowBuffer> row, int offset, TypeArgumentList value) {
|
||||
public int WriteTypeArgument(Reference<RowBuffer> row, int offset, TypeArgumentList value) {
|
||||
checkState(value.getCount() == 2);
|
||||
row.get().WriteSparseTypeCode(offset, this.LayoutCode);
|
||||
int lenInBytes = (com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutCode.SIZE / Byte.SIZE);
|
||||
|
||||
@@ -4,8 +4,9 @@
|
||||
|
||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
||||
|
||||
import com.azure.data.cosmos.core.OutObject;
|
||||
import com.azure.data.cosmos.core.RefObject;
|
||||
import com.azure.data.cosmos.core.Out;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.Result;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
||||
@@ -30,32 +31,32 @@ public final class LayoutTypedSet extends LayoutUniqueScope {
|
||||
}
|
||||
|
||||
@Override
|
||||
public TypeArgument FieldType(RefObject<RowCursor> scope) {
|
||||
public TypeArgument FieldType(Reference<RowCursor> scope) {
|
||||
return scope.get().scopeTypeArgs.get(0).clone();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean HasImplicitTypeCode(RefObject<RowCursor> edit) {
|
||||
public boolean HasImplicitTypeCode(Reference<RowCursor> edit) {
|
||||
checkState(edit.get().index >= 0);
|
||||
checkState(edit.get().scopeTypeArgs.getCount() == 1);
|
||||
return !LayoutCodeTraits.AlwaysRequiresTypeCode(edit.get().scopeTypeArgs.get(0).getType().LayoutCode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TypeArgumentList ReadTypeArgumentList(RefObject<RowBuffer> row, int offset,
|
||||
OutObject<Integer> lenInBytes) {
|
||||
public TypeArgumentList ReadTypeArgumentList(Reference<RowBuffer> row, int offset,
|
||||
Out<Integer> lenInBytes) {
|
||||
return new TypeArgumentList(new TypeArgument[] { ReadTypeArgument(row, offset, lenInBytes) });
|
||||
}
|
||||
|
||||
@Override
|
||||
public void SetImplicitTypeCode(RefObject<RowCursor> edit) {
|
||||
public void SetImplicitTypeCode(Reference<RowCursor> edit) {
|
||||
edit.get().cellType = edit.get().scopeTypeArgs.get(0).getType();
|
||||
edit.get().cellTypeArgs = edit.get().scopeTypeArgs.get(0).getTypeArgs().clone();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result WriteScope(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
||||
TypeArgumentList typeArgs, OutObject<RowCursor> value) {
|
||||
public Result WriteScope(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||
TypeArgumentList typeArgs, Out<RowCursor> value) {
|
||||
return WriteScope(b, edit, typeArgs, value, UpdateOptions.Upsert);
|
||||
}
|
||||
|
||||
@@ -63,8 +64,8 @@ public final class LayoutTypedSet extends LayoutUniqueScope {
|
||||
//ORIGINAL LINE: public override Result WriteScope(ref RowBuffer b, ref RowCursor edit, TypeArgumentList
|
||||
// typeArgs, out RowCursor value, UpdateOptions options = UpdateOptions.Upsert)
|
||||
@Override
|
||||
public Result WriteScope(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
||||
TypeArgumentList typeArgs, OutObject<RowCursor> value, UpdateOptions options) {
|
||||
public Result WriteScope(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||
TypeArgumentList typeArgs, Out<RowCursor> value, UpdateOptions options) {
|
||||
Result result = PrepareSparseWrite(b, edit, new TypeArgument(this, typeArgs.clone()), options);
|
||||
if (result != Result.Success) {
|
||||
value.set(null);
|
||||
@@ -76,7 +77,7 @@ public final class LayoutTypedSet extends LayoutUniqueScope {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int WriteTypeArgument(RefObject<RowBuffer> row, int offset, TypeArgumentList value) {
|
||||
public int WriteTypeArgument(Reference<RowBuffer> row, int offset, TypeArgumentList value) {
|
||||
checkArgument(value.getCount() == 1);
|
||||
row.get().WriteSparseTypeCode(offset, this.LayoutCode);
|
||||
int lenInBytes = (com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutCode.SIZE / Byte.SIZE);
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
|
||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
||||
|
||||
import com.azure.data.cosmos.core.OutObject;
|
||||
import com.azure.data.cosmos.core.RefObject;
|
||||
import com.azure.data.cosmos.core.Out;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.Result;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
||||
@@ -37,20 +37,20 @@ public final class LayoutTypedTuple extends LayoutIndexedScope {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean HasImplicitTypeCode(RefObject<RowCursor> edit) {
|
||||
public boolean HasImplicitTypeCode(Reference<RowCursor> edit) {
|
||||
checkArgument(edit.get().index >= 0);
|
||||
checkArgument(edit.get().scopeTypeArgs.getCount() > edit.get().index);
|
||||
return !LayoutCodeTraits.AlwaysRequiresTypeCode(edit.get().scopeTypeArgs.get(edit.get().index).getType().LayoutCode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TypeArgumentList ReadTypeArgumentList(RefObject<RowBuffer> row, int offset,
|
||||
OutObject<Integer> lenInBytes) {
|
||||
public TypeArgumentList ReadTypeArgumentList(Reference<RowBuffer> row, int offset,
|
||||
Out<Integer> lenInBytes) {
|
||||
int numTypeArgs = row.get().intValue().Read7BitEncodedUInt(offset, lenInBytes);
|
||||
TypeArgument[] retval = new TypeArgument[numTypeArgs];
|
||||
for (int i = 0; i < numTypeArgs; i++) {
|
||||
int itemLenInBytes;
|
||||
OutObject<Integer> tempOut_itemLenInBytes = new OutObject<Integer>();
|
||||
Out<Integer> tempOut_itemLenInBytes = new Out<Integer>();
|
||||
retval[i] = LayoutType.ReadTypeArgument(row, offset + lenInBytes.get(), tempOut_itemLenInBytes);
|
||||
itemLenInBytes = tempOut_itemLenInBytes.get();
|
||||
lenInBytes.set(lenInBytes.get() + itemLenInBytes);
|
||||
@@ -60,14 +60,14 @@ public final class LayoutTypedTuple extends LayoutIndexedScope {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void SetImplicitTypeCode(RefObject<RowCursor> edit) {
|
||||
public void SetImplicitTypeCode(Reference<RowCursor> edit) {
|
||||
edit.get().cellType = edit.get().scopeTypeArgs.get(edit.get().index).getType();
|
||||
edit.get().cellTypeArgs = edit.get().scopeTypeArgs.get(edit.get().index).getTypeArgs().clone();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result WriteScope(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
||||
TypeArgumentList typeArgs, OutObject<RowCursor> value) {
|
||||
public Result WriteScope(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||
TypeArgumentList typeArgs, Out<RowCursor> value) {
|
||||
return WriteScope(b, edit, typeArgs, value, UpdateOptions.Upsert);
|
||||
}
|
||||
|
||||
@@ -75,8 +75,8 @@ public final class LayoutTypedTuple extends LayoutIndexedScope {
|
||||
//ORIGINAL LINE: public override Result WriteScope(ref RowBuffer b, ref RowCursor edit, TypeArgumentList
|
||||
// typeArgs, out RowCursor value, UpdateOptions options = UpdateOptions.Upsert)
|
||||
@Override
|
||||
public Result WriteScope(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
||||
TypeArgumentList typeArgs, OutObject<RowCursor> value, UpdateOptions options) {
|
||||
public Result WriteScope(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||
TypeArgumentList typeArgs, Out<RowCursor> value, UpdateOptions options) {
|
||||
Result result = LayoutType.PrepareSparseWrite(b, edit, new TypeArgument(this, typeArgs.clone()), options);
|
||||
if (result != Result.Success) {
|
||||
value.set(null);
|
||||
@@ -88,7 +88,7 @@ public final class LayoutTypedTuple extends LayoutIndexedScope {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int WriteTypeArgument(RefObject<RowBuffer> row, int offset, TypeArgumentList value) {
|
||||
public int WriteTypeArgument(Reference<RowBuffer> row, int offset, TypeArgumentList value) {
|
||||
row.get().WriteSparseTypeCode(offset, this.LayoutCode);
|
||||
int lenInBytes = (com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutCode.SIZE / Byte.SIZE);
|
||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||
|
||||
@@ -4,8 +4,9 @@
|
||||
|
||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
||||
|
||||
import com.azure.data.cosmos.core.OutObject;
|
||||
import com.azure.data.cosmos.core.RefObject;
|
||||
import com.azure.data.cosmos.core.Out;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.Result;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
||||
@@ -28,16 +29,16 @@ public final class LayoutUDT extends LayoutPropertyScope {
|
||||
}
|
||||
|
||||
@Override
|
||||
public TypeArgumentList ReadTypeArgumentList(RefObject<RowBuffer> row, int offset,
|
||||
OutObject<Integer> lenInBytes) {
|
||||
public TypeArgumentList ReadTypeArgumentList(Reference<RowBuffer> row, int offset,
|
||||
Out<Integer> lenInBytes) {
|
||||
SchemaId schemaId = row.get().ReadSchemaId(offset).clone();
|
||||
lenInBytes.set(SchemaId.Size);
|
||||
return new TypeArgumentList(schemaId.clone());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result WriteScope(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
||||
TypeArgumentList typeArgs, OutObject<RowCursor> value) {
|
||||
public Result WriteScope(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||
TypeArgumentList typeArgs, Out<RowCursor> value) {
|
||||
return WriteScope(b, edit, typeArgs, value, UpdateOptions.Upsert);
|
||||
}
|
||||
|
||||
@@ -45,8 +46,8 @@ public final class LayoutUDT extends LayoutPropertyScope {
|
||||
//ORIGINAL LINE: public override Result WriteScope(ref RowBuffer b, ref RowCursor edit, TypeArgumentList
|
||||
// typeArgs, out RowCursor value, UpdateOptions options = UpdateOptions.Upsert)
|
||||
@Override
|
||||
public Result WriteScope(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
||||
TypeArgumentList typeArgs, OutObject<RowCursor> value, UpdateOptions options) {
|
||||
public Result WriteScope(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||
TypeArgumentList typeArgs, Out<RowCursor> value, UpdateOptions options) {
|
||||
Layout udt = b.get().getResolver().Resolve(typeArgs.getSchemaId().clone());
|
||||
Result result = PrepareSparseWrite(b, edit, new TypeArgument(this, typeArgs.clone()), options);
|
||||
if (result != Result.Success) {
|
||||
@@ -59,7 +60,7 @@ public final class LayoutUDT extends LayoutPropertyScope {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int WriteTypeArgument(RefObject<RowBuffer> row, int offset, TypeArgumentList value) {
|
||||
public int WriteTypeArgument(Reference<RowBuffer> row, int offset, TypeArgumentList value) {
|
||||
row.get().WriteSparseTypeCode(offset, this.LayoutCode);
|
||||
row.get().WriteSchemaId(offset + (com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutCode.SIZE / Byte.SIZE), value.getSchemaId().clone());
|
||||
return (com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutCode.SIZE / Byte.SIZE) + SchemaId.Size;
|
||||
|
||||
@@ -4,8 +4,9 @@
|
||||
|
||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
||||
|
||||
import com.azure.data.cosmos.core.OutObject;
|
||||
import com.azure.data.cosmos.core.RefObject;
|
||||
import com.azure.data.cosmos.core.Out;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.Result;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
||||
@@ -33,8 +34,8 @@ public final class LayoutUInt16 extends LayoutType<Short> {
|
||||
//ORIGINAL LINE: public override Result ReadFixed(ref RowBuffer b, ref RowCursor scope, LayoutColumn col, out
|
||||
// ushort value)
|
||||
@Override
|
||||
public Result ReadFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
||||
OutObject<Short> value) {
|
||||
public Result ReadFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col,
|
||||
Out<Short> value) {
|
||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||
if (!b.get().ReadBit(scope.get().start, col.getNullBit().clone())) {
|
||||
value.set(0);
|
||||
@@ -48,8 +49,8 @@ public final class LayoutUInt16 extends LayoutType<Short> {
|
||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||
//ORIGINAL LINE: public override Result ReadSparse(ref RowBuffer b, ref RowCursor edit, out ushort value)
|
||||
@Override
|
||||
public Result ReadSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
||||
OutObject<Short> value) {
|
||||
public Result ReadSparse(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||
Out<Short> value) {
|
||||
Result result = PrepareSparseRead(b, edit, this.LayoutCode);
|
||||
if (result != Result.Success) {
|
||||
value.set(0);
|
||||
@@ -64,7 +65,7 @@ public final class LayoutUInt16 extends LayoutType<Short> {
|
||||
//ORIGINAL LINE: public override Result WriteFixed(ref RowBuffer b, ref RowCursor scope, LayoutColumn col, ushort
|
||||
// value)
|
||||
@Override
|
||||
public Result WriteFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
||||
public Result WriteFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col,
|
||||
short value) {
|
||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||
if (scope.get().immutable) {
|
||||
@@ -81,7 +82,7 @@ public final class LayoutUInt16 extends LayoutType<Short> {
|
||||
// UpdateOptions options = UpdateOptions.Upsert)
|
||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||
@Override
|
||||
public Result WriteSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit, short value,
|
||||
public Result WriteSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, short value,
|
||||
UpdateOptions options) {
|
||||
Result result = PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options);
|
||||
if (result != Result.Success) {
|
||||
@@ -93,7 +94,7 @@ public final class LayoutUInt16 extends LayoutType<Short> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result WriteSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit, short value) {
|
||||
public Result WriteSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, short value) {
|
||||
return WriteSparse(b, edit, value, UpdateOptions.Upsert);
|
||||
}
|
||||
}
|
||||
@@ -4,8 +4,9 @@
|
||||
|
||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
||||
|
||||
import com.azure.data.cosmos.core.OutObject;
|
||||
import com.azure.data.cosmos.core.RefObject;
|
||||
import com.azure.data.cosmos.core.Out;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.Result;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
||||
@@ -33,8 +34,8 @@ public final class LayoutUInt32 extends LayoutType<Integer> {
|
||||
//ORIGINAL LINE: public override Result ReadFixed(ref RowBuffer b, ref RowCursor scope, LayoutColumn col, out
|
||||
// uint value)
|
||||
@Override
|
||||
public Result ReadFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
||||
OutObject<Integer> value) {
|
||||
public Result ReadFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col,
|
||||
Out<Integer> value) {
|
||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||
if (!b.get().ReadBit(scope.get().start, col.getNullBit().clone())) {
|
||||
value.set(0);
|
||||
@@ -48,8 +49,8 @@ public final class LayoutUInt32 extends LayoutType<Integer> {
|
||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||
//ORIGINAL LINE: public override Result ReadSparse(ref RowBuffer b, ref RowCursor edit, out uint value)
|
||||
@Override
|
||||
public Result ReadSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
||||
OutObject<Integer> value) {
|
||||
public Result ReadSparse(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||
Out<Integer> value) {
|
||||
Result result = PrepareSparseRead(b, edit, this.LayoutCode);
|
||||
if (result != Result.Success) {
|
||||
value.set(0);
|
||||
@@ -64,7 +65,7 @@ public final class LayoutUInt32 extends LayoutType<Integer> {
|
||||
//ORIGINAL LINE: public override Result WriteFixed(ref RowBuffer b, ref RowCursor scope, LayoutColumn col, uint
|
||||
// value)
|
||||
@Override
|
||||
public Result WriteFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
||||
public Result WriteFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col,
|
||||
int value) {
|
||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||
if (scope.get().immutable) {
|
||||
@@ -81,7 +82,7 @@ public final class LayoutUInt32 extends LayoutType<Integer> {
|
||||
// UpdateOptions options = UpdateOptions.Upsert)
|
||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||
@Override
|
||||
public Result WriteSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit, int value,
|
||||
public Result WriteSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, int value,
|
||||
UpdateOptions options) {
|
||||
Result result = PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options);
|
||||
if (result != Result.Success) {
|
||||
@@ -93,7 +94,7 @@ public final class LayoutUInt32 extends LayoutType<Integer> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result WriteSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit, int value) {
|
||||
public Result WriteSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, int value) {
|
||||
return WriteSparse(b, edit, value, UpdateOptions.Upsert);
|
||||
}
|
||||
}
|
||||
@@ -4,8 +4,9 @@
|
||||
|
||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
||||
|
||||
import com.azure.data.cosmos.core.OutObject;
|
||||
import com.azure.data.cosmos.core.RefObject;
|
||||
import com.azure.data.cosmos.core.Out;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.Result;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
||||
@@ -33,8 +34,8 @@ public final class LayoutUInt64 extends LayoutType<Long> {
|
||||
//ORIGINAL LINE: public override Result ReadFixed(ref RowBuffer b, ref RowCursor scope, LayoutColumn col, out
|
||||
// ulong value)
|
||||
@Override
|
||||
public Result ReadFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
||||
OutObject<Long> value) {
|
||||
public Result ReadFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col,
|
||||
Out<Long> value) {
|
||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||
if (!b.get().ReadBit(scope.get().start, col.getNullBit().clone())) {
|
||||
value.set(0);
|
||||
@@ -48,8 +49,8 @@ public final class LayoutUInt64 extends LayoutType<Long> {
|
||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||
//ORIGINAL LINE: public override Result ReadSparse(ref RowBuffer b, ref RowCursor edit, out ulong value)
|
||||
@Override
|
||||
public Result ReadSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
||||
OutObject<Long> value) {
|
||||
public Result ReadSparse(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||
Out<Long> value) {
|
||||
Result result = PrepareSparseRead(b, edit, this.LayoutCode);
|
||||
if (result != Result.Success) {
|
||||
value.set(0);
|
||||
@@ -64,7 +65,7 @@ public final class LayoutUInt64 extends LayoutType<Long> {
|
||||
//ORIGINAL LINE: public override Result WriteFixed(ref RowBuffer b, ref RowCursor scope, LayoutColumn col, ulong
|
||||
// value)
|
||||
@Override
|
||||
public Result WriteFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
||||
public Result WriteFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col,
|
||||
long value) {
|
||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||
if (scope.get().immutable) {
|
||||
@@ -81,7 +82,7 @@ public final class LayoutUInt64 extends LayoutType<Long> {
|
||||
// UpdateOptions options = UpdateOptions.Upsert)
|
||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||
@Override
|
||||
public Result WriteSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit, long value,
|
||||
public Result WriteSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, long value,
|
||||
UpdateOptions options) {
|
||||
Result result = PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options);
|
||||
if (result != Result.Success) {
|
||||
@@ -93,7 +94,7 @@ public final class LayoutUInt64 extends LayoutType<Long> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result WriteSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit, long value) {
|
||||
public Result WriteSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, long value) {
|
||||
return WriteSparse(b, edit, value, UpdateOptions.Upsert);
|
||||
}
|
||||
}
|
||||
@@ -4,8 +4,9 @@
|
||||
|
||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
||||
|
||||
import com.azure.data.cosmos.core.OutObject;
|
||||
import com.azure.data.cosmos.core.RefObject;
|
||||
import com.azure.data.cosmos.core.Out;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.Result;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
||||
@@ -33,8 +34,8 @@ public final class LayoutUInt8 extends LayoutType<Byte> {
|
||||
//ORIGINAL LINE: public override Result ReadFixed(ref RowBuffer b, ref RowCursor scope, LayoutColumn col, out
|
||||
// byte value)
|
||||
@Override
|
||||
public Result ReadFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
||||
OutObject<Byte> value) {
|
||||
public Result ReadFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col,
|
||||
Out<Byte> value) {
|
||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||
if (!b.get().ReadBit(scope.get().start, col.getNullBit().clone())) {
|
||||
value.set(0);
|
||||
@@ -48,8 +49,8 @@ public final class LayoutUInt8 extends LayoutType<Byte> {
|
||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||
//ORIGINAL LINE: public override Result ReadSparse(ref RowBuffer b, ref RowCursor edit, out byte value)
|
||||
@Override
|
||||
public Result ReadSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
||||
OutObject<Byte> value) {
|
||||
public Result ReadSparse(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||
Out<Byte> value) {
|
||||
Result result = PrepareSparseRead(b, edit, this.LayoutCode);
|
||||
if (result != Result.Success) {
|
||||
value.set(0);
|
||||
@@ -64,7 +65,7 @@ public final class LayoutUInt8 extends LayoutType<Byte> {
|
||||
//ORIGINAL LINE: public override Result WriteFixed(ref RowBuffer b, ref RowCursor scope, LayoutColumn col, byte
|
||||
// value)
|
||||
@Override
|
||||
public Result WriteFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
||||
public Result WriteFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col,
|
||||
byte value) {
|
||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||
if (scope.get().immutable) {
|
||||
@@ -81,7 +82,7 @@ public final class LayoutUInt8 extends LayoutType<Byte> {
|
||||
// UpdateOptions options = UpdateOptions.Upsert)
|
||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||
@Override
|
||||
public Result WriteSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit, byte value,
|
||||
public Result WriteSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, byte value,
|
||||
UpdateOptions options) {
|
||||
Result result = PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options);
|
||||
if (result != Result.Success) {
|
||||
@@ -93,7 +94,7 @@ public final class LayoutUInt8 extends LayoutType<Byte> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result WriteSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit, byte value) {
|
||||
public Result WriteSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, byte value) {
|
||||
return WriteSparse(b, edit, value, UpdateOptions.Upsert);
|
||||
}
|
||||
}
|
||||
@@ -4,8 +4,9 @@
|
||||
|
||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
||||
|
||||
import com.azure.data.cosmos.core.OutObject;
|
||||
import com.azure.data.cosmos.core.RefObject;
|
||||
import com.azure.data.cosmos.core.Out;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.Result;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
||||
@@ -21,7 +22,7 @@ public abstract class LayoutUniqueScope extends LayoutIndexedScope {
|
||||
super(code, immutable, isSizedScope, false, true, isTypedScope);
|
||||
}
|
||||
|
||||
public abstract TypeArgument FieldType(RefObject<RowCursor> scope);
|
||||
public abstract TypeArgument FieldType(Reference<RowCursor> scope);
|
||||
|
||||
/**
|
||||
* Search for a matching field within a unique index.
|
||||
@@ -35,8 +36,8 @@ public abstract class LayoutUniqueScope extends LayoutIndexedScope {
|
||||
* <p>
|
||||
* The pattern field is delete whether the find succeeds or fails.
|
||||
*/
|
||||
public final Result Find(RefObject<RowBuffer> b, RefObject<RowCursor> scope,
|
||||
RefObject<RowCursor> patternScope, OutObject<RowCursor> value) {
|
||||
public final Result Find(Reference<RowBuffer> b, Reference<RowCursor> scope,
|
||||
Reference<RowCursor> patternScope, Out<RowCursor> value) {
|
||||
Result result = LayoutType.PrepareSparseMove(b, scope, this, this.FieldType(scope).clone(), patternScope, UpdateOptions.Update, value.clone());
|
||||
|
||||
if (result != Result.Success) {
|
||||
@@ -52,11 +53,11 @@ public abstract class LayoutUniqueScope extends LayoutIndexedScope {
|
||||
//C# TO JAVA CONVERTER NOTE: Java does not support optional parameters. Overloaded method(s) are created above:
|
||||
//ORIGINAL LINE: public Result MoveField(ref RowBuffer b, ref RowCursor destinationScope, ref RowCursor
|
||||
// sourceEdit, UpdateOptions options = UpdateOptions.Upsert)
|
||||
public final Result MoveField(RefObject<RowBuffer> b, RefObject<RowCursor> destinationScope,
|
||||
RefObject<RowCursor> sourceEdit, UpdateOptions options) {
|
||||
public final Result MoveField(Reference<RowBuffer> b, Reference<RowCursor> destinationScope,
|
||||
Reference<RowCursor> sourceEdit, UpdateOptions options) {
|
||||
RowCursor dstEdit;
|
||||
OutObject<RowCursor> tempOut_dstEdit =
|
||||
new OutObject<RowCursor>();
|
||||
Out<RowCursor> tempOut_dstEdit =
|
||||
new Out<RowCursor>();
|
||||
Result result = LayoutType.PrepareSparseMove(b, destinationScope, this,
|
||||
this.FieldType(destinationScope).clone(), sourceEdit, options, tempOut_dstEdit);
|
||||
dstEdit = tempOut_dstEdit.get();
|
||||
@@ -66,10 +67,10 @@ public abstract class LayoutUniqueScope extends LayoutIndexedScope {
|
||||
}
|
||||
|
||||
// Perform the move.
|
||||
RefObject<RowCursor> tempRef_dstEdit =
|
||||
new RefObject<RowCursor>(dstEdit);
|
||||
b.get().TypedCollectionMoveField(tempRef_dstEdit, sourceEdit, RowOptions.forValue(options));
|
||||
dstEdit = tempRef_dstEdit.get();
|
||||
Reference<RowCursor> tempReference_dstEdit =
|
||||
new Reference<RowCursor>(dstEdit);
|
||||
b.get().TypedCollectionMoveField(tempReference_dstEdit, sourceEdit, RowOptions.forValue(options));
|
||||
dstEdit = tempReference_dstEdit.get();
|
||||
|
||||
// TODO: it would be "better" if the destinationScope were updated to point to the
|
||||
// highest item seen. Then we would avoid the maximum reparse.
|
||||
@@ -92,8 +93,8 @@ public abstract class LayoutUniqueScope extends LayoutIndexedScope {
|
||||
* The source field is delete whether the move succeeds or fails.
|
||||
*/
|
||||
|
||||
public final Result MoveField(RefObject<RowBuffer> b, RefObject<RowCursor> destinationScope,
|
||||
RefObject<RowCursor> sourceEdit) {
|
||||
public final Result MoveField(Reference<RowBuffer> b, Reference<RowCursor> destinationScope,
|
||||
Reference<RowCursor> sourceEdit) {
|
||||
return MoveField(b, destinationScope, sourceEdit, UpdateOptions.Upsert);
|
||||
}
|
||||
|
||||
@@ -102,12 +103,12 @@ public abstract class LayoutUniqueScope extends LayoutIndexedScope {
|
||||
// TypeArgumentList typeArgs, TContext context, WriterFunc<TContext> func, UpdateOptions options = UpdateOptions
|
||||
// .Upsert)
|
||||
@Override
|
||||
public <TContext> Result WriteScope(RefObject<RowBuffer> b, RefObject<RowCursor> scope,
|
||||
public <TContext> Result WriteScope(Reference<RowBuffer> b, Reference<RowCursor> scope,
|
||||
TypeArgumentList typeArgs, TContext context, WriterFunc<TContext> func,
|
||||
UpdateOptions options) {
|
||||
RowCursor uniqueScope;
|
||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
|
||||
// cannot be converted using the 'OutObject' helper class unless the method is within the code being modified:
|
||||
// cannot be converted using the 'Out' helper class unless the method is within the code being modified:
|
||||
Result r = this.WriteScope(b, scope, typeArgs.clone(), out uniqueScope, options);
|
||||
if (r != Result.Success) {
|
||||
return r;
|
||||
@@ -115,39 +116,39 @@ public abstract class LayoutUniqueScope extends LayoutIndexedScope {
|
||||
|
||||
RowCursor childScope;
|
||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
|
||||
// cannot be converted using the 'OutObject' helper class unless the method is within the code being modified:
|
||||
// cannot be converted using the 'Out' helper class unless the method is within the code being modified:
|
||||
uniqueScope.Clone(out childScope);
|
||||
childScope.deferUniqueIndex = true;
|
||||
RefObject<RowCursor> tempRef_childScope =
|
||||
new RefObject<RowCursor>(childScope);
|
||||
Reference<RowCursor> tempReference_childScope =
|
||||
new Reference<RowCursor>(childScope);
|
||||
// TODO: C# TO JAVA CONVERTER: The following line could not be converted:
|
||||
r = func == null ? null : func.Invoke(ref b, ref childScope, context) ??Result.Success;
|
||||
childScope = tempRef_childScope.get();
|
||||
childScope = tempReference_childScope.get();
|
||||
if (r != Result.Success) {
|
||||
this.DeleteScope(b, scope);
|
||||
return r;
|
||||
}
|
||||
|
||||
uniqueScope.count = childScope.count;
|
||||
RefObject<RowCursor> tempRef_uniqueScope =
|
||||
new RefObject<RowCursor>(uniqueScope);
|
||||
r = b.get().TypedCollectionUniqueIndexRebuild(tempRef_uniqueScope);
|
||||
uniqueScope = tempRef_uniqueScope.get();
|
||||
Reference<RowCursor> tempReference_uniqueScope =
|
||||
new Reference<RowCursor>(uniqueScope);
|
||||
r = b.get().TypedCollectionUniqueIndexRebuild(tempReference_uniqueScope);
|
||||
uniqueScope = tempReference_uniqueScope.get();
|
||||
if (r != Result.Success) {
|
||||
this.DeleteScope(b, scope);
|
||||
return r;
|
||||
}
|
||||
|
||||
RefObject<RowCursor> tempRef_childScope2 =
|
||||
new RefObject<RowCursor>(childScope);
|
||||
Reference<RowCursor> tempReference_childScope2 =
|
||||
new Reference<RowCursor>(childScope);
|
||||
RowCursorExtensions.Skip(scope.get().clone(), b,
|
||||
tempRef_childScope2);
|
||||
childScope = tempRef_childScope2.get();
|
||||
tempReference_childScope2);
|
||||
childScope = tempReference_childScope2.get();
|
||||
return Result.Success;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <TContext> Result WriteScope(RefObject<RowBuffer> b, RefObject<RowCursor> scope,
|
||||
public <TContext> Result WriteScope(Reference<RowBuffer> b, Reference<RowCursor> scope,
|
||||
TypeArgumentList typeArgs, TContext context, WriterFunc<TContext> func) {
|
||||
return WriteScope(b, scope, typeArgs, context, func, UpdateOptions.Upsert);
|
||||
}
|
||||
|
||||
@@ -4,8 +4,9 @@
|
||||
|
||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
||||
|
||||
import com.azure.data.cosmos.core.OutObject;
|
||||
import com.azure.data.cosmos.core.RefObject;
|
||||
import com.azure.data.cosmos.core.Out;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.Result;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
||||
@@ -30,8 +31,8 @@ public final class LayoutUnixDateTime extends LayoutType<com.azure.data.cosmos.s
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result ReadFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
||||
OutObject<UnixDateTime> value) {
|
||||
public Result ReadFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col,
|
||||
Out<UnixDateTime> value) {
|
||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||
if (!b.get().ReadBit(scope.get().start, col.getNullBit().clone())) {
|
||||
value.set(null);
|
||||
@@ -43,8 +44,8 @@ public final class LayoutUnixDateTime extends LayoutType<com.azure.data.cosmos.s
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result ReadSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
||||
OutObject<UnixDateTime> value) {
|
||||
public Result ReadSparse(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||
Out<UnixDateTime> value) {
|
||||
Result result = PrepareSparseRead(b, edit, this.LayoutCode);
|
||||
if (result != Result.Success) {
|
||||
value.set(null);
|
||||
@@ -56,7 +57,7 @@ public final class LayoutUnixDateTime extends LayoutType<com.azure.data.cosmos.s
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result WriteFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
||||
public Result WriteFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col,
|
||||
UnixDateTime value) {
|
||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||
if (scope.get().immutable) {
|
||||
@@ -72,7 +73,7 @@ public final class LayoutUnixDateTime extends LayoutType<com.azure.data.cosmos.s
|
||||
//ORIGINAL LINE: public override Result WriteSparse(ref RowBuffer b, ref RowCursor edit, UnixDateTime value,
|
||||
// UpdateOptions options = UpdateOptions.Upsert)
|
||||
@Override
|
||||
public Result WriteSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit, UnixDateTime value
|
||||
public Result WriteSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, UnixDateTime value
|
||||
, UpdateOptions options) {
|
||||
Result result = PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options);
|
||||
if (result != Result.Success) {
|
||||
@@ -84,7 +85,7 @@ public final class LayoutUnixDateTime extends LayoutType<com.azure.data.cosmos.s
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result WriteSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit, UnixDateTime value) {
|
||||
public Result WriteSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, UnixDateTime value) {
|
||||
return WriteSparse(b, edit, value, UpdateOptions.Upsert);
|
||||
}
|
||||
}
|
||||
@@ -4,8 +4,9 @@
|
||||
|
||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
||||
|
||||
import com.azure.data.cosmos.core.OutObject;
|
||||
import com.azure.data.cosmos.core.RefObject;
|
||||
import com.azure.data.cosmos.core.Out;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.Result;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
||||
@@ -28,19 +29,19 @@ public final class LayoutUtf8 extends LayoutType<String> implements ILayoutUtf8S
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result ReadFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
||||
OutObject<String> value) {
|
||||
public Result ReadFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col,
|
||||
Out<String> value) {
|
||||
Utf8Span span;
|
||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
|
||||
// cannot be converted using the 'OutObject' helper class unless the method is within the code being modified:
|
||||
// cannot be converted using the 'Out' helper class unless the method is within the code being modified:
|
||||
Result r = this.ReadFixed(b, scope, col, out span);
|
||||
value.set((r == Result.Success) ? span.toString() :)
|
||||
default
|
||||
return r;
|
||||
}
|
||||
|
||||
public Result ReadFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
||||
OutObject<Utf8Span> value) {
|
||||
public Result ReadFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col,
|
||||
Out<Utf8Span> value) {
|
||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||
checkArgument(col.getSize() >= 0);
|
||||
if (!b.get().ReadBit(scope.get().start, col.getNullBit().clone())) {
|
||||
@@ -53,18 +54,18 @@ public final class LayoutUtf8 extends LayoutType<String> implements ILayoutUtf8S
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result ReadSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
||||
OutObject<String> value) {
|
||||
public Result ReadSparse(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||
Out<String> value) {
|
||||
Utf8Span span;
|
||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
|
||||
// cannot be converted using the 'OutObject' helper class unless the method is within the code being modified:
|
||||
// cannot be converted using the 'Out' helper class unless the method is within the code being modified:
|
||||
Result r = this.ReadSparse(b, edit, out span);
|
||||
value.set((r == Result.Success) ? span.toString() :)
|
||||
default
|
||||
return r;
|
||||
}
|
||||
|
||||
public Result ReadSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit, OutObject<Utf8Span> value) {
|
||||
public Result ReadSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, Out<Utf8Span> value) {
|
||||
Result result = LayoutType.PrepareSparseRead(b, edit, this.LayoutCode);
|
||||
if (result != Result.Success) {
|
||||
value.set(null);
|
||||
@@ -76,19 +77,19 @@ public final class LayoutUtf8 extends LayoutType<String> implements ILayoutUtf8S
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result ReadVariable(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col
|
||||
, OutObject<String> value) {
|
||||
public Result ReadVariable(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col
|
||||
, Out<String> value) {
|
||||
Utf8Span span;
|
||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
|
||||
// cannot be converted using the 'OutObject' helper class unless the method is within the code being modified:
|
||||
// cannot be converted using the 'Out' helper class unless the method is within the code being modified:
|
||||
Result r = this.ReadVariable(b, scope, col, out span);
|
||||
value.set((r == Result.Success) ? span.toString() :)
|
||||
default
|
||||
return r;
|
||||
}
|
||||
|
||||
public Result ReadVariable(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col
|
||||
, OutObject<Utf8Span> value) {
|
||||
public Result ReadVariable(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col
|
||||
, Out<Utf8Span> value) {
|
||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||
if (!b.get().ReadBit(scope.get().start, col.getNullBit().clone())) {
|
||||
value.set(null);
|
||||
@@ -102,13 +103,13 @@ public final class LayoutUtf8 extends LayoutType<String> implements ILayoutUtf8S
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result WriteFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
||||
public Result WriteFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col,
|
||||
String value) {
|
||||
checkArgument(value != null);
|
||||
return this.WriteFixed(b, scope, col, Utf8Span.TranscodeUtf16(value));
|
||||
}
|
||||
|
||||
public Result WriteFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
||||
public Result WriteFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col,
|
||||
Utf8Span value) {
|
||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||
checkArgument(col.getSize() >= 0);
|
||||
@@ -123,7 +124,7 @@ public final class LayoutUtf8 extends LayoutType<String> implements ILayoutUtf8S
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result WriteSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit, String value) {
|
||||
public Result WriteSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, String value) {
|
||||
return WriteSparse(b, edit, value, UpdateOptions.Upsert);
|
||||
}
|
||||
|
||||
@@ -131,21 +132,21 @@ public final class LayoutUtf8 extends LayoutType<String> implements ILayoutUtf8S
|
||||
//ORIGINAL LINE: public override Result WriteSparse(ref RowBuffer b, ref RowCursor edit, string value,
|
||||
// UpdateOptions options = UpdateOptions.Upsert)
|
||||
@Override
|
||||
public Result WriteSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit, String value,
|
||||
public Result WriteSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, String value,
|
||||
UpdateOptions options) {
|
||||
checkArgument(value != null);
|
||||
return this.WriteSparse(b, edit, Utf8Span.TranscodeUtf16(value), options);
|
||||
}
|
||||
|
||||
|
||||
public Result WriteSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit, Utf8Span value) {
|
||||
public Result WriteSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, Utf8Span value) {
|
||||
return WriteSparse(b, edit, value, UpdateOptions.Upsert);
|
||||
}
|
||||
|
||||
//C# TO JAVA CONVERTER NOTE: Java does not support optional parameters. Overloaded method(s) are created above:
|
||||
//ORIGINAL LINE: public Result WriteSparse(ref RowBuffer b, ref RowCursor edit, Utf8Span value, UpdateOptions
|
||||
// options = UpdateOptions.Upsert)
|
||||
public Result WriteSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit, Utf8Span value,
|
||||
public Result WriteSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, Utf8Span value,
|
||||
UpdateOptions options) {
|
||||
Result result = LayoutType.PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options);
|
||||
if (result != Result.Success) {
|
||||
@@ -157,13 +158,13 @@ public final class LayoutUtf8 extends LayoutType<String> implements ILayoutUtf8S
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result WriteVariable(RefObject<RowBuffer> b, RefObject<RowCursor> scope,
|
||||
public Result WriteVariable(Reference<RowBuffer> b, Reference<RowCursor> scope,
|
||||
LayoutColumn col, String value) {
|
||||
checkArgument(value != null);
|
||||
return this.WriteVariable(b, scope, col, Utf8Span.TranscodeUtf16(value));
|
||||
}
|
||||
|
||||
public Result WriteVariable(RefObject<RowBuffer> b, RefObject<RowCursor> scope,
|
||||
public Result WriteVariable(Reference<RowBuffer> b, Reference<RowCursor> scope,
|
||||
LayoutColumn col, Utf8Span value) {
|
||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||
if (scope.get().immutable) {
|
||||
@@ -179,7 +180,7 @@ public final class LayoutUtf8 extends LayoutType<String> implements ILayoutUtf8S
|
||||
int varOffset = b.get().ComputeVariableValueOffset(scope.get().layout, scope.get().start,
|
||||
col.getOffset());
|
||||
int shift;
|
||||
OutObject<Integer> tempOut_shift = new OutObject<Integer>();
|
||||
Out<Integer> tempOut_shift = new Out<Integer>();
|
||||
b.get().WriteVariableString(varOffset, value, exists, tempOut_shift);
|
||||
shift = tempOut_shift.get();
|
||||
b.get().SetBit(scope.get().start, col.getNullBit().clone());
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
|
||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
||||
|
||||
import com.azure.data.cosmos.core.OutObject;
|
||||
import com.azure.data.cosmos.core.RefObject;
|
||||
import com.azure.data.cosmos.core.Out;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.Result;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
||||
@@ -33,15 +33,15 @@ public final class LayoutVarInt extends LayoutType<Long> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result ReadFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
||||
OutObject<Long> value) {
|
||||
public Result ReadFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col,
|
||||
Out<Long> value) {
|
||||
Contract.Fail("Not Implemented");
|
||||
value.set(0);
|
||||
return Result.Failure;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result ReadSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit, OutObject<Long> value) {
|
||||
public Result ReadSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, Out<Long> value) {
|
||||
Result result = LayoutType.PrepareSparseRead(b, edit, this.LayoutCode);
|
||||
if (result != Result.Success) {
|
||||
value.set(0);
|
||||
@@ -53,7 +53,7 @@ public final class LayoutVarInt extends LayoutType<Long> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result ReadVariable(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col, OutObject<Long> value) {
|
||||
public Result ReadVariable(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col, Out<Long> value) {
|
||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||
if (!b.get().ReadBit(scope.get().start, col.getNullBit().clone())) {
|
||||
value.set(0);
|
||||
@@ -67,7 +67,7 @@ public final class LayoutVarInt extends LayoutType<Long> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result WriteFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
||||
public Result WriteFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col,
|
||||
long value) {
|
||||
Contract.Fail("Not Implemented");
|
||||
return Result.Failure;
|
||||
@@ -77,7 +77,7 @@ public final class LayoutVarInt extends LayoutType<Long> {
|
||||
//ORIGINAL LINE: public override Result WriteSparse(ref RowBuffer b, ref RowCursor edit, long value,
|
||||
// UpdateOptions options = UpdateOptions.Upsert)
|
||||
@Override
|
||||
public Result WriteSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit, long value,
|
||||
public Result WriteSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, long value,
|
||||
UpdateOptions options) {
|
||||
Result result = LayoutType.PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options);
|
||||
if (result != Result.Success) {
|
||||
@@ -89,12 +89,12 @@ public final class LayoutVarInt extends LayoutType<Long> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result WriteSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit, long value) {
|
||||
public Result WriteSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, long value) {
|
||||
return WriteSparse(b, edit, value, UpdateOptions.Upsert);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result WriteVariable(RefObject<RowBuffer> b, RefObject<RowCursor> scope,
|
||||
public Result WriteVariable(Reference<RowBuffer> b, Reference<RowCursor> scope,
|
||||
LayoutColumn col, long value) {
|
||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||
if (scope.get().immutable) {
|
||||
@@ -105,7 +105,7 @@ public final class LayoutVarInt extends LayoutType<Long> {
|
||||
int varOffset = b.get().ComputeVariableValueOffset(scope.get().layout, scope.get().start,
|
||||
col.getOffset());
|
||||
int shift;
|
||||
OutObject<Integer> tempOut_shift = new OutObject<Integer>();
|
||||
Out<Integer> tempOut_shift = new Out<Integer>();
|
||||
b.get().WriteVariableInt(varOffset, value, exists, tempOut_shift);
|
||||
shift = tempOut_shift.get();
|
||||
b.get().SetBit(scope.get().start, col.getNullBit().clone());
|
||||
|
||||
@@ -4,8 +4,9 @@
|
||||
|
||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
||||
|
||||
import com.azure.data.cosmos.core.OutObject;
|
||||
import com.azure.data.cosmos.core.RefObject;
|
||||
import com.azure.data.cosmos.core.Out;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.Result;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
||||
@@ -38,8 +39,8 @@ public final class LayoutVarUInt extends LayoutType<Long> {
|
||||
//ORIGINAL LINE: public override Result ReadFixed(ref RowBuffer b, ref RowCursor scope, LayoutColumn col, out
|
||||
// ulong value)
|
||||
@Override
|
||||
public Result ReadFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
||||
OutObject<Long> value) {
|
||||
public Result ReadFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col,
|
||||
Out<Long> value) {
|
||||
Contract.Fail("Not Implemented");
|
||||
value.set(0);
|
||||
return Result.Failure;
|
||||
@@ -48,7 +49,7 @@ public final class LayoutVarUInt extends LayoutType<Long> {
|
||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||
//ORIGINAL LINE: public override Result ReadSparse(ref RowBuffer b, ref RowCursor edit, out ulong value)
|
||||
@Override
|
||||
public Result ReadSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit, OutObject<Long> value) {
|
||||
public Result ReadSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, Out<Long> value) {
|
||||
Result result = PrepareSparseRead(b, edit, this.LayoutCode);
|
||||
if (result != Result.Success) {
|
||||
value.set(0);
|
||||
@@ -63,7 +64,7 @@ public final class LayoutVarUInt extends LayoutType<Long> {
|
||||
//ORIGINAL LINE: public override Result ReadVariable(ref RowBuffer b, ref RowCursor scope, LayoutColumn col, out
|
||||
// ulong value)
|
||||
@Override
|
||||
public Result ReadVariable(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col, OutObject<Long> value) {
|
||||
public Result ReadVariable(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col, Out<Long> value) {
|
||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||
if (!b.get().ReadBit(scope.get().start, col.getNullBit().clone())) {
|
||||
value.set(0);
|
||||
@@ -80,7 +81,7 @@ public final class LayoutVarUInt extends LayoutType<Long> {
|
||||
//ORIGINAL LINE: public override Result WriteFixed(ref RowBuffer b, ref RowCursor scope, LayoutColumn col, ulong
|
||||
// value)
|
||||
@Override
|
||||
public Result WriteFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
||||
public Result WriteFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col,
|
||||
long value) {
|
||||
Contract.Fail("Not Implemented");
|
||||
return Result.Failure;
|
||||
@@ -91,7 +92,7 @@ public final class LayoutVarUInt extends LayoutType<Long> {
|
||||
// UpdateOptions options = UpdateOptions.Upsert)
|
||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||
@Override
|
||||
public Result WriteSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit, long value,
|
||||
public Result WriteSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, long value,
|
||||
UpdateOptions options) {
|
||||
Result result = PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options);
|
||||
if (result != Result.Success) {
|
||||
@@ -103,7 +104,7 @@ public final class LayoutVarUInt extends LayoutType<Long> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result WriteSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit, long value) {
|
||||
public Result WriteSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, long value) {
|
||||
return WriteSparse(b, edit, value, UpdateOptions.Upsert);
|
||||
}
|
||||
|
||||
@@ -111,7 +112,7 @@ public final class LayoutVarUInt extends LayoutType<Long> {
|
||||
//ORIGINAL LINE: public override Result WriteVariable(ref RowBuffer b, ref RowCursor scope, LayoutColumn col,
|
||||
// ulong value)
|
||||
@Override
|
||||
public Result WriteVariable(RefObject<RowBuffer> b, RefObject<RowCursor> scope,
|
||||
public Result WriteVariable(Reference<RowBuffer> b, Reference<RowCursor> scope,
|
||||
LayoutColumn col, long value) {
|
||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||
if (scope.get().immutable) {
|
||||
@@ -122,7 +123,7 @@ public final class LayoutVarUInt extends LayoutType<Long> {
|
||||
int varOffset = b.get().ComputeVariableValueOffset(scope.get().layout, scope.get().start,
|
||||
col.getOffset());
|
||||
int shift;
|
||||
OutObject<Integer> tempOut_shift = new OutObject<Integer>();
|
||||
Out<Integer> tempOut_shift = new Out<Integer>();
|
||||
b.get().WriteVariableUInt(varOffset, value, exists, tempOut_shift);
|
||||
shift = tempOut_shift.get();
|
||||
b.get().SetBit(scope.get().start, col.getNullBit().clone());
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
||||
|
||||
import com.azure.data.cosmos.core.OutObject;
|
||||
import com.azure.data.cosmos.core.Out;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
@@ -21,7 +21,7 @@ public final class StringTokenizer {
|
||||
private HashMap<Utf8String, StringToken> tokens;
|
||||
|
||||
/**
|
||||
* Initializes a new instance of the <see cref="StringTokenizer" /> class.
|
||||
* Initializes a new instance of the {@link StringTokenizer} class.
|
||||
*/
|
||||
public StringTokenizer() {
|
||||
this.tokens = new HashMap<Utf8String, StringToken>(Map.ofEntries(Map.entry(Utf8String.Empty,
|
||||
@@ -68,7 +68,7 @@ public final class StringTokenizer {
|
||||
*/
|
||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||
//ORIGINAL LINE: public bool TryFindString(ulong token, out Utf8String path)
|
||||
public boolean TryFindString(long token, OutObject<Utf8String> path) {
|
||||
public boolean TryFindString(long token, Out<Utf8String> path) {
|
||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||
//ORIGINAL LINE: if (token >= (ulong)this.strings.Count)
|
||||
if (token >= (long)this.strings.size()) {
|
||||
@@ -87,7 +87,7 @@ public final class StringTokenizer {
|
||||
* @param token If successful, the string's assigned token.
|
||||
* @return True if successful, false otherwise.
|
||||
*/
|
||||
public boolean TryFindToken(UtfAnyString path, OutObject<StringToken> token) {
|
||||
public boolean TryFindToken(UtfAnyString path, Out<StringToken> token) {
|
||||
if (path.IsNull) {
|
||||
token.set(null);
|
||||
return false;
|
||||
|
||||
@@ -19,7 +19,7 @@ public final class TypeArgument implements IEquatable<TypeArgument> {
|
||||
private TypeArgumentList typeArgs = new TypeArgumentList();
|
||||
|
||||
/**
|
||||
* Initializes a new instance of the <see cref="TypeArgument" /> struct.
|
||||
* Initializes a new instance of the {@link TypeArgument} struct.
|
||||
*
|
||||
* @param type The type of the constraint.
|
||||
*/
|
||||
@@ -34,7 +34,7 @@ public final class TypeArgument implements IEquatable<TypeArgument> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes a new instance of the <see cref="TypeArgument" /> struct.
|
||||
* Initializes a new instance of the {@link TypeArgument} struct.
|
||||
*
|
||||
* @param type The type of the constraint.
|
||||
* @param typeArgs For generic types the type parameters.
|
||||
|
||||
@@ -41,7 +41,7 @@ public final class TypeArgumentList implements IEquatable<TypeArgumentList> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes a new instance of the <see cref="TypeArgumentList" /> struct.
|
||||
* Initializes a new instance of the {@link TypeArgumentList} struct.
|
||||
*
|
||||
* @param schemaId For UDT fields, the schema id of the nested layout.
|
||||
*/
|
||||
@@ -141,7 +141,7 @@ public final class TypeArgumentList implements IEquatable<TypeArgumentList> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Enumerates the elements of a <see cref="TypeArgumentList" />.
|
||||
* Enumerates the elements of a {@link TypeArgumentList}.
|
||||
*/
|
||||
//C# TO JAVA CONVERTER WARNING: Java does not allow user-defined value types. The behavior of this class may
|
||||
// differ from the original:
|
||||
@@ -157,7 +157,7 @@ public final class TypeArgumentList implements IEquatable<TypeArgumentList> {
|
||||
private TypeArgument[] list;
|
||||
|
||||
/**
|
||||
* Initializes a new instance of the <see cref="Enumerator" /> struct.
|
||||
* Initializes a new instance of the {@link Enumerator} struct.
|
||||
*
|
||||
* @param list The list to enumerate.
|
||||
*/
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
||||
|
||||
/**
|
||||
* Describes the desired behavior when writing a <see cref="LayoutType" />.
|
||||
* Describes the desired behavior when writing a {@link LayoutType}.
|
||||
*/
|
||||
public enum UpdateOptions {
|
||||
None(0),
|
||||
@@ -31,8 +31,8 @@ public enum UpdateOptions {
|
||||
/**
|
||||
* Update an existing value or insert a new value, if no value exists.
|
||||
* <p>
|
||||
* If a value exists, then this operation becomes <see cref="Update" />, otherwise it becomes
|
||||
* <see cref="Insert" />.
|
||||
* If a value exists, then this operation becomes {@link Update}, otherwise it becomes
|
||||
* {@link Insert}.
|
||||
*/
|
||||
Upsert(3),
|
||||
|
||||
@@ -40,7 +40,7 @@ public enum UpdateOptions {
|
||||
* Insert a new value moving existing values to the right.
|
||||
* <p>
|
||||
* Within an array scope, inserts a new value immediately at the index moving all subsequent
|
||||
* items to the right. In any other scope behaves the same as <see cref="Upsert" />.
|
||||
* items to the right. In any other scope behaves the same as {@link Upsert}.
|
||||
*/
|
||||
InsertAt(4);
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
package com.azure.data.cosmos.serialization.hybridrow.recordio;
|
||||
|
||||
import com.azure.data.cosmos.core.OutObject;
|
||||
import com.azure.data.cosmos.core.Out;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.HybridRowHeader;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.HybridRowVersion;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.ISpanResizer;
|
||||
@@ -15,7 +15,7 @@ public final class RecordIOFormatter {
|
||||
public static final Layout RecordLayout = SystemSchema.LayoutResolver.Resolve(SystemSchema.RecordSchemaId);
|
||||
public static final Layout SegmentLayout = SystemSchema.LayoutResolver.Resolve(SystemSchema.SegmentSchemaId);
|
||||
|
||||
public static Result FormatRecord(ReadOnlyMemory<Byte> body, OutObject<RowBuffer> row) {
|
||||
public static Result FormatRecord(ReadOnlyMemory<Byte> body, Out<RowBuffer> row) {
|
||||
return FormatRecord(body, row, null);
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ public final class RecordIOFormatter {
|
||||
//ORIGINAL LINE: public static Result FormatRecord(ReadOnlyMemory<byte> body, out RowBuffer row,
|
||||
// ISpanResizer<byte> resizer = default)
|
||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||
public static Result FormatRecord(ReadOnlyMemory<Byte> body, OutObject<RowBuffer> row,
|
||||
public static Result FormatRecord(ReadOnlyMemory<Byte> body, Out<RowBuffer> row,
|
||||
ISpanResizer<Byte> resizer) {
|
||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||
//ORIGINAL LINE: resizer = resizer != null ? resizer : DefaultSpanResizer<byte>.Default;
|
||||
@@ -37,7 +37,7 @@ public final class RecordIOFormatter {
|
||||
RecordSerializer.Write, row.clone());
|
||||
}
|
||||
|
||||
public static Result FormatSegment(Segment segment, OutObject<RowBuffer> row) {
|
||||
public static Result FormatSegment(Segment segment, Out<RowBuffer> row) {
|
||||
return FormatSegment(segment, row, null);
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ public final class RecordIOFormatter {
|
||||
//ORIGINAL LINE: public static Result FormatSegment(Segment segment, out RowBuffer row, ISpanResizer<byte>
|
||||
// resizer = default)
|
||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||
public static Result FormatSegment(Segment segment, OutObject<RowBuffer> row, ISpanResizer<Byte> resizer) {
|
||||
public static Result FormatSegment(Segment segment, Out<RowBuffer> row, ISpanResizer<Byte> resizer) {
|
||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||
//ORIGINAL LINE: resizer = resizer != null ? resizer : DefaultSpanResizer<byte>.Default;
|
||||
resizer = resizer != null ? resizer : DefaultSpanResizer < Byte >.Default;
|
||||
@@ -62,7 +62,7 @@ public final class RecordIOFormatter {
|
||||
//ORIGINAL LINE: private static Result FormatObject<T>(ISpanResizer<byte> resizer, int initialCapacity, Layout
|
||||
// layout, T obj, RowWriter.WriterFunc<T> writer, out RowBuffer row)
|
||||
private static <T> Result FormatObject(ISpanResizer<Byte> resizer, int initialCapacity, Layout layout, T obj,
|
||||
RowWriter.WriterFunc<T> writer, OutObject<RowBuffer> row) {
|
||||
RowWriter.WriterFunc<T> writer, Out<RowBuffer> row) {
|
||||
row.set(new RowBuffer(initialCapacity, resizer));
|
||||
row.get().InitLayout(HybridRowVersion.V1, layout, SystemSchema.LayoutResolver);
|
||||
Result r = RowWriter.WriteBuffer(row.clone(), obj, writer);
|
||||
|
||||
@@ -4,8 +4,9 @@
|
||||
|
||||
package com.azure.data.cosmos.serialization.hybridrow.recordio;
|
||||
|
||||
import com.azure.data.cosmos.core.OutObject;
|
||||
import com.azure.data.cosmos.core.RefObject;
|
||||
import com.azure.data.cosmos.core.Out;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.HybridRowHeader;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.HybridRowVersion;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.Result;
|
||||
@@ -47,9 +48,9 @@ public final class RecordIOParser {
|
||||
* recommended that Process not be called again until at least this number of bytes are available.
|
||||
* @param consumed The number of bytes consumed from the input buffer. This number may be less
|
||||
* than the total buffer size if the parser moved to a new state.
|
||||
* @return <see cref="azure.data.cosmos.serialization.hybridrow.Result.Success" /> if no error
|
||||
* @return {@link azure.data.cosmos.serialization.hybridrow.Result.Success} if no error
|
||||
* has occurred, otherwise a valid
|
||||
* <see cref="azure.data.cosmos.serialization.hybridrow.Result" /> of the last error encountered
|
||||
* {@link azure.data.cosmos.serialization.hybridrow.Result} of the last error encountered
|
||||
* during parsing.
|
||||
* <p>
|
||||
* >
|
||||
@@ -57,9 +58,9 @@ public final class RecordIOParser {
|
||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||
//ORIGINAL LINE: public Result Process(Memory<byte> buffer, out ProductionType type, out Memory<byte> record, out
|
||||
// int need, out int consumed)
|
||||
public Result Process(Memory<Byte> buffer, OutObject<ProductionType> type,
|
||||
OutObject<Memory<Byte>> record, OutObject<Integer> need,
|
||||
OutObject<Integer> consumed) {
|
||||
public Result Process(Memory<Byte> buffer, Out<ProductionType> type,
|
||||
Out<Memory<Byte>> record, Out<Integer> need,
|
||||
Out<Integer> consumed) {
|
||||
Result r = Result.Failure;
|
||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||
//ORIGINAL LINE: Memory<byte> b = buffer;
|
||||
@@ -82,17 +83,17 @@ public final class RecordIOParser {
|
||||
//ORIGINAL LINE: Span<byte> span = b.Span.Slice(0, minimalSegmentRowSize);
|
||||
Span<Byte> span = b.Span.Slice(0, minimalSegmentRowSize);
|
||||
RowBuffer row = new RowBuffer(span, HybridRowVersion.V1, SystemSchema.LayoutResolver);
|
||||
RefObject<RowBuffer> tempRef_row =
|
||||
new RefObject<RowBuffer>(row);
|
||||
RowReader reader = new RowReader(tempRef_row);
|
||||
row = tempRef_row.get();
|
||||
RefObject<RowReader> tempRef_reader =
|
||||
new RefObject<RowReader>(reader);
|
||||
OutObject<Segment> tempOut_segment =
|
||||
new OutObject<Segment>();
|
||||
r = SegmentSerializer.Read(tempRef_reader, tempOut_segment);
|
||||
Reference<RowBuffer> tempReference_row =
|
||||
new Reference<RowBuffer>(row);
|
||||
RowReader reader = new RowReader(tempReference_row);
|
||||
row = tempReference_row.get();
|
||||
Reference<RowReader> tempReference_reader =
|
||||
new Reference<RowReader>(reader);
|
||||
Out<Segment> tempOut_segment =
|
||||
new Out<Segment>();
|
||||
r = SegmentSerializer.Read(tempReference_reader, tempOut_segment);
|
||||
this.segment = tempOut_segment.get();
|
||||
reader = tempRef_reader.get();
|
||||
reader = tempReference_reader.get();
|
||||
if (r != Result.Success) {
|
||||
break;
|
||||
}
|
||||
@@ -113,17 +114,17 @@ public final class RecordIOParser {
|
||||
//ORIGINAL LINE: Span<byte> span = b.Span.Slice(0, this.segment.Length);
|
||||
Span<Byte> span = b.Span.Slice(0, this.segment.Length);
|
||||
RowBuffer row = new RowBuffer(span, HybridRowVersion.V1, SystemSchema.LayoutResolver);
|
||||
RefObject<RowBuffer> tempRef_row2 =
|
||||
new RefObject<RowBuffer>(row);
|
||||
RowReader reader = new RowReader(tempRef_row2);
|
||||
row = tempRef_row2.get();
|
||||
RefObject<RowReader> tempRef_reader2 =
|
||||
new RefObject<RowReader>(reader);
|
||||
OutObject<Segment> tempOut_segment2
|
||||
= new OutObject<Segment>();
|
||||
r = SegmentSerializer.Read(tempRef_reader2, tempOut_segment2);
|
||||
Reference<RowBuffer> tempReference_row2 =
|
||||
new Reference<RowBuffer>(row);
|
||||
RowReader reader = new RowReader(tempReference_row2);
|
||||
row = tempReference_row2.get();
|
||||
Reference<RowReader> tempReference_reader2 =
|
||||
new Reference<RowReader>(reader);
|
||||
Out<Segment> tempOut_segment2
|
||||
= new Out<Segment>();
|
||||
r = SegmentSerializer.Read(tempReference_reader2, tempOut_segment2);
|
||||
this.segment = tempOut_segment2.get();
|
||||
reader = tempRef_reader2.get();
|
||||
reader = tempReference_reader2.get();
|
||||
if (r != Result.Success) {
|
||||
break;
|
||||
}
|
||||
@@ -146,7 +147,7 @@ public final class RecordIOParser {
|
||||
|
||||
HybridRowHeader header;
|
||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword -
|
||||
// these cannot be converted using the 'OutObject' helper class unless the method is within the code
|
||||
// these cannot be converted using the 'Out' helper class unless the method is within the code
|
||||
// being modified:
|
||||
MemoryMarshal.TryRead(b.Span, out header);
|
||||
if (header.Version != HybridRowVersion.V1) {
|
||||
@@ -182,15 +183,15 @@ public final class RecordIOParser {
|
||||
//ORIGINAL LINE: Span<byte> span = b.Span.Slice(0, minimalRecordRowSize);
|
||||
Span<Byte> span = b.Span.Slice(0, minimalRecordRowSize);
|
||||
RowBuffer row = new RowBuffer(span, HybridRowVersion.V1, SystemSchema.LayoutResolver);
|
||||
RefObject<RowBuffer> tempRef_row3 =
|
||||
new RefObject<RowBuffer>(row);
|
||||
RowReader reader = new RowReader(tempRef_row3);
|
||||
row = tempRef_row3.get();
|
||||
RefObject<RowReader> tempRef_reader3 = new RefObject<RowReader>(reader);
|
||||
OutObject<Record> tempOut_record = new OutObject<Record>();
|
||||
r = RecordSerializer.Read(tempRef_reader3, tempOut_record);
|
||||
Reference<RowBuffer> tempReference_row3 =
|
||||
new Reference<RowBuffer>(row);
|
||||
RowReader reader = new RowReader(tempReference_row3);
|
||||
row = tempReference_row3.get();
|
||||
Reference<RowReader> tempReference_reader3 = new Reference<RowReader>(reader);
|
||||
Out<Record> tempOut_record = new Out<Record>();
|
||||
r = RecordSerializer.Read(tempReference_reader3, tempOut_record);
|
||||
this.record = tempOut_record.get();
|
||||
reader = tempRef_reader3.get();
|
||||
reader = tempReference_reader3.get();
|
||||
if (r != Result.Success) {
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
package com.azure.data.cosmos.serialization.hybridrow.recordio;
|
||||
|
||||
import com.azure.data.cosmos.core.OutObject;
|
||||
import com.azure.data.cosmos.core.Out;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.MemorySpanResizer;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.Result;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||
@@ -33,7 +33,7 @@ public final class RecordIOStream {
|
||||
* @param stm The stream to read from.
|
||||
* @param visitRecord A (required) delegate that is called once for each record.
|
||||
* <p>
|
||||
* <paramref name="visitRecord" /> is passed a <see cref="Memory{T}" /> of the byte sequence
|
||||
* <paramref name="visitRecord" /> is passed a {@link Memory{T}} of the byte sequence
|
||||
* of the
|
||||
* record body's row buffer.
|
||||
* </p>
|
||||
@@ -45,7 +45,7 @@ public final class RecordIOStream {
|
||||
* over.
|
||||
* </p>
|
||||
* <p>
|
||||
* <paramref name="visitSegment" /> is passed a <see cref="Memory{T}" /> of the byte sequence of
|
||||
* <paramref name="visitSegment" /> is passed a {@link Memory{T}} of the byte sequence of
|
||||
* the segment header's row buffer.
|
||||
* </p>
|
||||
* <p>If <paramref name="visitSegment" /> returns an error then the sequence is aborted.</p>
|
||||
@@ -109,12 +109,12 @@ public final class RecordIOStream {
|
||||
while (avail.Length > 0) {
|
||||
// Loop around processing available data until we don't have anymore
|
||||
RecordIOParser.ProductionType prodType;
|
||||
OutObject<RecordIOParser.ProductionType> tempOut_prodType = new OutObject<RecordIOParser.ProductionType>();
|
||||
Out<RecordIOParser.ProductionType> tempOut_prodType = new Out<RecordIOParser.ProductionType>();
|
||||
Memory<Byte> record;
|
||||
OutObject<Memory<Byte>> tempOut_record = new OutObject<Memory<Byte>>();
|
||||
OutObject<Integer> tempOut_need = new OutObject<Integer>();
|
||||
Out<Memory<Byte>> tempOut_record = new Out<Memory<Byte>>();
|
||||
Out<Integer> tempOut_need = new Out<Integer>();
|
||||
int consumed;
|
||||
OutObject<Integer> tempOut_consumed = new OutObject<Integer>();
|
||||
Out<Integer> tempOut_consumed = new Out<Integer>();
|
||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||
//ORIGINAL LINE: Result r = parser.Process(avail, out RecordIOParser.ProductionType prodType, out
|
||||
// Memory<byte> record, out need, out int consumed);
|
||||
@@ -207,7 +207,7 @@ public final class RecordIOStream {
|
||||
segment.clone(), index ->
|
||||
{
|
||||
ReadOnlyMemory<Byte> buffer;
|
||||
OutObject<ReadOnlyMemory<Byte>> tempOut_buffer = new OutObject<ReadOnlyMemory<Byte>>();
|
||||
Out<ReadOnlyMemory<Byte>> tempOut_buffer = new Out<ReadOnlyMemory<Byte>>();
|
||||
buffer = tempOut_buffer.get();
|
||||
return new ValueTask<(Result, ReadOnlyMemory < Byte >) > ((r,buffer))
|
||||
}, resizer);
|
||||
@@ -250,7 +250,7 @@ public final class RecordIOStream {
|
||||
|
||||
// Write a RecordIO stream.
|
||||
Memory<Byte> metadata;
|
||||
OutObject<Memory<Byte>> tempOut_metadata = new OutObject<Memory<Byte>>();
|
||||
Out<Memory<Byte>> tempOut_metadata = new Out<Memory<Byte>>();
|
||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||
//ORIGINAL LINE: Result r = RecordIOStream.FormatSegment(segment, resizer, out Memory<byte> metadata);
|
||||
Result r = RecordIOStream.FormatSegment(segment.clone(), resizer, tempOut_metadata);
|
||||
@@ -277,7 +277,7 @@ public final class RecordIOStream {
|
||||
break;
|
||||
}
|
||||
|
||||
OutObject<Memory<Byte>> tempOut_metadata2 = new OutObject<Memory<Byte>>();
|
||||
Out<Memory<Byte>> tempOut_metadata2 = new Out<Memory<Byte>>();
|
||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||
//ORIGINAL LINE: r = RecordIOStream.FormatRow(body, resizer, out metadata);
|
||||
r = RecordIOStream.FormatRow(body, resizer, tempOut_metadata2);
|
||||
@@ -311,9 +311,9 @@ public final class RecordIOStream {
|
||||
*/
|
||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||
//ORIGINAL LINE: private static Result FormatRow(ReadOnlyMemory<byte> body, MemorySpanResizer<byte> resizer, out Memory<byte> block)
|
||||
private static Result FormatRow(ReadOnlyMemory<Byte> body, MemorySpanResizer<Byte> resizer, OutObject<Memory<Byte>> block) {
|
||||
private static Result FormatRow(ReadOnlyMemory<Byte> body, MemorySpanResizer<Byte> resizer, Out<Memory<Byte>> block) {
|
||||
RowBuffer row;
|
||||
OutObject<RowBuffer> tempOut_row = new OutObject<RowBuffer>();
|
||||
Out<RowBuffer> tempOut_row = new Out<RowBuffer>();
|
||||
Result r = RecordIOFormatter.FormatRecord(body, tempOut_row, resizer);
|
||||
row = tempOut_row.get();
|
||||
if (r != Result.Success) {
|
||||
@@ -337,10 +337,10 @@ public final class RecordIOStream {
|
||||
//ORIGINAL LINE: private static Result FormatSegment(Segment segment, MemorySpanResizer<byte> resizer, out
|
||||
// Memory<byte> block)
|
||||
private static Result FormatSegment(Segment segment, MemorySpanResizer<Byte> resizer,
|
||||
OutObject<Memory<Byte>> block) {
|
||||
Out<Memory<Byte>> block) {
|
||||
RowBuffer row;
|
||||
OutObject<RowBuffer> tempOut_row =
|
||||
new OutObject<RowBuffer>();
|
||||
Out<RowBuffer> tempOut_row =
|
||||
new Out<RowBuffer>();
|
||||
Result r = RecordIOFormatter.FormatSegment(segment.clone(), tempOut_row, resizer);
|
||||
row = tempOut_row.get();
|
||||
if (r != Result.Success) {
|
||||
@@ -364,6 +364,6 @@ public final class RecordIOStream {
|
||||
*/
|
||||
@FunctionalInterface
|
||||
public interface ProduceFunc {
|
||||
Result invoke(long index, OutObject<ReadOnlyMemory<Byte>> buffer);
|
||||
Result invoke(long index, Out<ReadOnlyMemory<Byte>> buffer);
|
||||
}
|
||||
}
|
||||
@@ -4,12 +4,13 @@
|
||||
|
||||
package com.azure.data.cosmos.serialization.hybridrow.recordio;
|
||||
|
||||
import com.azure.data.cosmos.core.OutObject;
|
||||
import com.azure.data.cosmos.core.RefObject;
|
||||
import com.azure.data.cosmos.core.Out;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.Result;
|
||||
|
||||
public final class RecordSerializer {
|
||||
public static Result Read(RefObject<RowReader> reader, OutObject<Record> obj) {
|
||||
public static Result Read(Reference<RowReader> reader, Out<Record> obj) {
|
||||
obj.set(null);
|
||||
while (reader.get().Read()) {
|
||||
Result r;
|
||||
@@ -17,7 +18,7 @@ public final class RecordSerializer {
|
||||
// TODO: use Path tokens here.
|
||||
switch (reader.get().getPath().toString()) {
|
||||
case "length":
|
||||
OutObject<Integer> tempOut_Length = new OutObject<Integer>();
|
||||
Out<Integer> tempOut_Length = new Out<Integer>();
|
||||
r = reader.get().ReadInt32(tempOut_Length);
|
||||
obj.get().argValue.Length = tempOut_Length.get();
|
||||
if (r != Result.Success) {
|
||||
@@ -26,7 +27,7 @@ public final class RecordSerializer {
|
||||
|
||||
break;
|
||||
case "crc32":
|
||||
OutObject<Integer> tempOut_Crc32 = new OutObject<Integer>();
|
||||
Out<Integer> tempOut_Crc32 = new Out<Integer>();
|
||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||
//ORIGINAL LINE: r = reader.ReadUInt32(out obj.Crc32);
|
||||
r = reader.get().ReadUInt32(tempOut_Crc32);
|
||||
@@ -42,7 +43,7 @@ public final class RecordSerializer {
|
||||
return Result.Success;
|
||||
}
|
||||
|
||||
public static Result Write(RefObject<RowWriter> writer, TypeArgument typeArg, Record obj) {
|
||||
public static Result Write(Reference<RowWriter> writer, TypeArgument typeArg, Record obj) {
|
||||
Result r;
|
||||
r = writer.get().WriteInt32("length", obj.Length);
|
||||
if (r != Result.Success) {
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
|
||||
package com.azure.data.cosmos.serialization.hybridrow.recordio;
|
||||
|
||||
import com.azure.data.cosmos.core.OutObject;
|
||||
import com.azure.data.cosmos.core.RefObject;
|
||||
import com.azure.data.cosmos.core.Out;
|
||||
import com.azure.data.cosmos.core.Reference;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.HybridRowVersion;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.Result;
|
||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||
@@ -14,20 +14,20 @@ import com.azure.data.cosmos.serialization.hybridrow.io.RowReader;
|
||||
public final class SegmentSerializer {
|
||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||
//ORIGINAL LINE: public static Result Read(Span<byte> span, LayoutResolver resolver, out Segment obj)
|
||||
public static Result Read(Span<Byte> span, LayoutResolver resolver, OutObject<Segment> obj) {
|
||||
public static Result Read(Span<Byte> span, LayoutResolver resolver, Out<Segment> obj) {
|
||||
RowBuffer row = new RowBuffer(span, HybridRowVersion.V1, resolver);
|
||||
RefObject<RowBuffer> tempRef_row =
|
||||
new RefObject<RowBuffer>(row);
|
||||
RowReader reader = new RowReader(tempRef_row);
|
||||
row = tempRef_row.get();
|
||||
RefObject<RowReader> tempRef_reader =
|
||||
new RefObject<RowReader>(reader);
|
||||
Result tempVar = SegmentSerializer.Read(tempRef_reader, obj.clone());
|
||||
reader = tempRef_reader.get();
|
||||
Reference<RowBuffer> tempReference_row =
|
||||
new Reference<RowBuffer>(row);
|
||||
RowReader reader = new RowReader(tempReference_row);
|
||||
row = tempReference_row.get();
|
||||
Reference<RowReader> tempReference_reader =
|
||||
new Reference<RowReader>(reader);
|
||||
Result tempVar = SegmentSerializer.Read(tempReference_reader, obj.clone());
|
||||
reader = tempReference_reader.get();
|
||||
return tempVar;
|
||||
}
|
||||
|
||||
public static Result Read(RefObject<RowReader> reader, OutObject<Segment> obj) {
|
||||
public static Result Read(Reference<RowReader> reader, Out<Segment> obj) {
|
||||
obj.set(null);
|
||||
while (reader.get().Read()) {
|
||||
Result r;
|
||||
@@ -35,7 +35,7 @@ public final class SegmentSerializer {
|
||||
// TODO: use Path tokens here.
|
||||
switch (reader.get().getPath().toString()) {
|
||||
case "length":
|
||||
OutObject<Integer> tempOut_Length = new OutObject<Integer>();
|
||||
Out<Integer> tempOut_Length = new Out<Integer>();
|
||||
r = reader.get().ReadInt32(tempOut_Length);
|
||||
obj.get().argValue.Length = tempOut_Length.get();
|
||||
if (r != Result.Success) {
|
||||
@@ -50,7 +50,7 @@ public final class SegmentSerializer {
|
||||
|
||||
break;
|
||||
case "comment":
|
||||
OutObject<String> tempOut_Comment = new OutObject<String>();
|
||||
Out<String> tempOut_Comment = new Out<String>();
|
||||
r = reader.get().ReadString(tempOut_Comment);
|
||||
obj.get().argValue.Comment = tempOut_Comment.get();
|
||||
if (r != Result.Success) {
|
||||
@@ -59,7 +59,7 @@ public final class SegmentSerializer {
|
||||
|
||||
break;
|
||||
case "sdl":
|
||||
OutObject<String> tempOut_SDL = new OutObject<String>();
|
||||
Out<String> tempOut_SDL = new Out<String>();
|
||||
r = reader.get().ReadString(tempOut_SDL);
|
||||
obj.get().argValue.SDL = tempOut_SDL.get();
|
||||
if (r != Result.Success) {
|
||||
@@ -73,7 +73,7 @@ public final class SegmentSerializer {
|
||||
return Result.Success;
|
||||
}
|
||||
|
||||
public static Result Write(RefObject<RowWriter> writer, TypeArgument typeArg, Segment obj) {
|
||||
public static Result Write(Reference<RowWriter> writer, TypeArgument typeArg, Segment obj) {
|
||||
Result r;
|
||||
if (obj.Comment != null) {
|
||||
r = writer.get().WriteString("comment", obj.Comment);
|
||||
|
||||
@@ -8,8 +8,8 @@ package com.azure.data.cosmos.serialization.hybridrow.schemas;
|
||||
* Array properties represent an unbounded set of zero or more items.
|
||||
* <p>
|
||||
* Arrays may be typed or untyped. Within typed arrays, all items MUST be the same type. The
|
||||
* type of items is specified via <see cref="Items" />. Typed arrays may be stored more efficiently
|
||||
* than untyped arrays. When <see cref="Items" /> is unspecified, the array is untyped and its items
|
||||
* type of items is specified via {@link Items}. Typed arrays may be stored more efficiently
|
||||
* than untyped arrays. When {@link Items} is unspecified, the array is untyped and its items
|
||||
* may be heterogeneous.
|
||||
*/
|
||||
public class ArrayPropertyType extends ScopePropertyType {
|
||||
|
||||
@@ -10,10 +10,10 @@ package com.azure.data.cosmos.serialization.hybridrow.schemas;
|
||||
* <p>
|
||||
* <p>
|
||||
* Maps are typed or untyped. Within typed maps, all key MUST be the same type, and all
|
||||
* values MUST be the same type. The type of both key and values is specified via <see cref="Keys" />
|
||||
* and <see cref="Values" /> respectively. Typed maps may be stored more efficiently than untyped
|
||||
* maps. When <see cref="Keys" /> or <see cref="Values" /> is unspecified or marked
|
||||
* <see cref="TypeKind.Any" />, the map is untyped and its key and/or values may be heterogeneous.
|
||||
* values MUST be the same type. The type of both key and values is specified via {@link Keys}
|
||||
* and {@link Values} respectively. Typed maps may be stored more efficiently than untyped
|
||||
* maps. When {@link Keys} or {@link Values} is unspecified or marked
|
||||
* {@link TypeKind.Any}, the map is untyped and its key and/or values may be heterogeneous.
|
||||
*/
|
||||
public class MapPropertyType extends ScopePropertyType {
|
||||
/**
|
||||
|
||||
@@ -16,7 +16,7 @@ import java.util.ArrayList;
|
||||
//ORIGINAL LINE: [JsonObject] public class Namespace
|
||||
public class Namespace {
|
||||
/**
|
||||
* The standard settings used by the JSON parser for interpreting <see cref="Namespace" />
|
||||
* The standard settings used by the JSON parser for interpreting {@link Namespace}
|
||||
* documents.
|
||||
*/
|
||||
private static final JsonSerializerSettings NamespaceParseSettings = new JsonSerializerSettings() {
|
||||
@@ -35,12 +35,12 @@ public class Namespace {
|
||||
//ORIGINAL LINE: [JsonProperty(PropertyName = "version")] public SchemaLanguageVersion Version {get;set;}
|
||||
private SchemaLanguageVersion Version = SchemaLanguageVersion.values()[0];
|
||||
/**
|
||||
* The set of schemas that make up the <see cref="Namespace" />.
|
||||
* The set of schemas that make up the {@link Namespace}.
|
||||
*/
|
||||
private ArrayList<Schema> schemas;
|
||||
|
||||
/**
|
||||
* Initializes a new instance of the <see cref="Namespace" /> class.
|
||||
* Initializes a new instance of the {@link Namespace} class.
|
||||
*/
|
||||
public Namespace() {
|
||||
this.setSchemas(new ArrayList<Schema>());
|
||||
@@ -55,7 +55,7 @@ public class Namespace {
|
||||
}
|
||||
|
||||
/**
|
||||
* The set of schemas that make up the <see cref="Namespace" />.
|
||||
* The set of schemas that make up the {@link Namespace}.
|
||||
* <p>
|
||||
* Namespaces may consist of zero or more table schemas along with zero or more UDT schemas.
|
||||
* Table schemas can only reference UDT schemas defined in the same namespace. UDT schemas can
|
||||
|
||||
@@ -12,7 +12,7 @@ import java.util.ArrayList;
|
||||
* Object properties map to multiple columns depending on the number of internal properties
|
||||
* within the defined object structure. Object properties are provided as a convince in schema
|
||||
* design. They are effectively equivalent to defining the same properties explicitly via
|
||||
* <see cref="PrimitivePropertyType" /> with nested property paths.
|
||||
* {@link PrimitivePropertyType} with nested property paths.
|
||||
*/
|
||||
public class ObjectPropertyType extends ScopePropertyType {
|
||||
/**
|
||||
@@ -21,7 +21,7 @@ public class ObjectPropertyType extends ScopePropertyType {
|
||||
private ArrayList<Property> properties;
|
||||
|
||||
/**
|
||||
* Initializes a new instance of the <see cref="ObjectPropertyType" /> class.
|
||||
* Initializes a new instance of the {@link ObjectPropertyType} class.
|
||||
*/
|
||||
public ObjectPropertyType() {
|
||||
this.properties = new ArrayList<Property>();
|
||||
|
||||
@@ -10,7 +10,7 @@ package com.azure.data.cosmos.serialization.hybridrow.schemas;
|
||||
public class PartitionKey {
|
||||
/**
|
||||
* The logical path of the referenced property.
|
||||
* Partition keys MUST refer to properties defined within the same <see cref="Schema" />.
|
||||
* Partition keys MUST refer to properties defined within the same {@link Schema}.
|
||||
*/
|
||||
// TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes:
|
||||
//ORIGINAL LINE: [JsonProperty(PropertyName = "path", Required = Required.Always)] public string Path {get;set;}
|
||||
|
||||
@@ -11,7 +11,7 @@ package com.azure.data.cosmos.serialization.hybridrow.schemas;
|
||||
public class PrimarySortKey {
|
||||
/**
|
||||
* The logical path of the referenced property.
|
||||
* Primary keys MUST refer to properties defined within the same <see cref="Schema" />.
|
||||
* Primary keys MUST refer to properties defined within the same {@link Schema}.
|
||||
*/
|
||||
// TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes:
|
||||
//ORIGINAL LINE: [JsonProperty(PropertyName = "direction", Required = Required.DisallowNull)] public
|
||||
@@ -19,7 +19,7 @@ public class PrimarySortKey {
|
||||
private SortDirection Direction = SortDirection.values()[0];
|
||||
/**
|
||||
* The logical path of the referenced property.
|
||||
* Primary keys MUST refer to properties defined within the same <see cref="Schema" />.
|
||||
* Primary keys MUST refer to properties defined within the same {@link Schema}.
|
||||
*/
|
||||
// TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes:
|
||||
//ORIGINAL LINE: [JsonProperty(PropertyName = "path", Required = Required.Always)] public string Path {get;set;}
|
||||
|
||||
@@ -9,7 +9,7 @@ import Newtonsoft.Json.Converters.*;
|
||||
import Newtonsoft.Json.Linq.*;
|
||||
|
||||
/**
|
||||
* Helper class for parsing the polymorphic <see cref="PropertyType" /> subclasses from JSON.
|
||||
* Helper class for parsing the polymorphic {@link PropertyType} subclasses from JSON.
|
||||
*/
|
||||
public class PropertySchemaConverter extends JsonConverter {
|
||||
@Override
|
||||
@@ -35,7 +35,7 @@ public class PropertySchemaConverter extends JsonConverter {
|
||||
|
||||
JToken value;
|
||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
|
||||
// cannot be converted using the 'OutObject' helper class unless the method is within the code being modified:
|
||||
// cannot be converted using the 'Out' helper class unless the method is within the code being modified:
|
||||
if (!propSchema.TryGetValue("type", out value)) {
|
||||
throw new JsonSerializationException("Required \"type\" property missing.");
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ public class Schema {
|
||||
//ORIGINAL LINE: [JsonProperty(PropertyName = "id", Required = Required.Always)] public SchemaId SchemaId {get;set;}
|
||||
private com.azure.data.cosmos.serialization.hybridrow.SchemaId SchemaId = new SchemaId();
|
||||
/**
|
||||
* The type of this schema. This value MUST be <see cref="TypeKind.Schema" />.
|
||||
* The type of this schema. This value MUST be {@link TypeKind.Schema}.
|
||||
*/
|
||||
// TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes:
|
||||
//ORIGINAL LINE: [DefaultValue(TypeKind.Schema)][JsonProperty(PropertyName = "type", Required = Required
|
||||
@@ -86,7 +86,7 @@ public class Schema {
|
||||
private ArrayList<StaticKey> staticKeys;
|
||||
|
||||
/**
|
||||
* Initializes a new instance of the <see cref="Schema" /> class.
|
||||
* Initializes a new instance of the {@link Schema} class.
|
||||
*/
|
||||
public Schema() {
|
||||
this.setType(TypeKind.Schema);
|
||||
|
||||
@@ -16,8 +16,8 @@ public final class SchemaHash {
|
||||
// default)
|
||||
// {
|
||||
// (ulong low, ulong high) hash = seed;
|
||||
// hash = MurmurHash3.Hash128(schema.SchemaId, hash);
|
||||
// hash = MurmurHash3.Hash128(schema.Type, hash);
|
||||
// hash = Murmur3Hash.Hash128(schema.SchemaId, hash);
|
||||
// hash = Murmur3Hash.Hash128(schema.Type, hash);
|
||||
// hash = SchemaHash.ComputeHash(ns, schema.Options, hash);
|
||||
// if (schema.PartitionKeys != null)
|
||||
// {
|
||||
@@ -59,12 +59,12 @@ public final class SchemaHash {
|
||||
// seed = default)
|
||||
// {
|
||||
// (ulong low, ulong high) hash = seed;
|
||||
// hash = MurmurHash3.Hash128(options == null ? null : options.DisallowUnschematized ?? false, hash);
|
||||
// hash = MurmurHash3.Hash128(options == null ? null : options.EnablePropertyLevelTimestamp ?? false,
|
||||
// hash = Murmur3Hash.Hash128(options == null ? null : options.DisallowUnschematized ?? false, hash);
|
||||
// hash = Murmur3Hash.Hash128(options == null ? null : options.EnablePropertyLevelTimestamp ?? false,
|
||||
// hash);
|
||||
// if (options == null ? null : options.DisableSystemPrefix ?? false)
|
||||
// {
|
||||
// hash = MurmurHash3.Hash128(true, hash);
|
||||
// hash = Murmur3Hash.Hash128(true, hash);
|
||||
// }
|
||||
//
|
||||
// return hash;
|
||||
@@ -76,7 +76,7 @@ public final class SchemaHash {
|
||||
// {
|
||||
// Contract.Requires(p != null);
|
||||
// (ulong low, ulong high) hash = seed;
|
||||
// hash = MurmurHash3.Hash128(p.Path, hash);
|
||||
// hash = Murmur3Hash.Hash128(p.Path, hash);
|
||||
// hash = SchemaHash.ComputeHash(ns, p.PropertyType, hash);
|
||||
// return hash;
|
||||
// }
|
||||
@@ -87,21 +87,21 @@ public final class SchemaHash {
|
||||
// {
|
||||
// Contract.Requires(p != null);
|
||||
// (ulong low, ulong high) hash = seed;
|
||||
// hash = MurmurHash3.Hash128(p.Type, hash);
|
||||
// hash = MurmurHash3.Hash128(p.Nullable, hash);
|
||||
// hash = Murmur3Hash.Hash128(p.Type, hash);
|
||||
// hash = Murmur3Hash.Hash128(p.Nullable, hash);
|
||||
// if (p.ApiType != null)
|
||||
// {
|
||||
// hash = MurmurHash3.Hash128(p.ApiType, hash);
|
||||
// hash = Murmur3Hash.Hash128(p.ApiType, hash);
|
||||
// }
|
||||
//
|
||||
// switch (p)
|
||||
// {
|
||||
// case PrimitivePropertyType pp:
|
||||
// hash = MurmurHash3.Hash128(pp.Storage, hash);
|
||||
// hash = MurmurHash3.Hash128(pp.Length, hash);
|
||||
// hash = Murmur3Hash.Hash128(pp.Storage, hash);
|
||||
// hash = Murmur3Hash.Hash128(pp.Length, hash);
|
||||
// break;
|
||||
// case ScopePropertyType pp:
|
||||
// hash = MurmurHash3.Hash128(pp.Immutable, hash);
|
||||
// hash = Murmur3Hash.Hash128(pp.Immutable, hash);
|
||||
// switch (p)
|
||||
// {
|
||||
// case ArrayPropertyType spp:
|
||||
@@ -199,7 +199,7 @@ public final class SchemaHash {
|
||||
// (ulong low, ulong high) hash = seed;
|
||||
// if (key != null)
|
||||
// {
|
||||
// hash = MurmurHash3.Hash128(key.Path, hash);
|
||||
// hash = Murmur3Hash.Hash128(key.Path, hash);
|
||||
// }
|
||||
//
|
||||
// return hash;
|
||||
@@ -211,8 +211,8 @@ public final class SchemaHash {
|
||||
// (ulong low, ulong high) hash = seed;
|
||||
// if (key != null)
|
||||
// {
|
||||
// hash = MurmurHash3.Hash128(key.Path, hash);
|
||||
// hash = MurmurHash3.Hash128(key.Direction, hash);
|
||||
// hash = Murmur3Hash.Hash128(key.Path, hash);
|
||||
// hash = Murmur3Hash.Hash128(key.Direction, hash);
|
||||
// }
|
||||
//
|
||||
// return hash;
|
||||
@@ -224,7 +224,7 @@ public final class SchemaHash {
|
||||
// (ulong low, ulong high) hash = seed;
|
||||
// if (key != null)
|
||||
// {
|
||||
// hash = MurmurHash3.Hash128(key.Path, hash);
|
||||
// hash = Murmur3Hash.Hash128(key.Path, hash);
|
||||
// }
|
||||
//
|
||||
// return hash;
|
||||
|
||||
@@ -165,7 +165,7 @@ HashMap<SchemaId, Schema> ids
|
||||
/**
|
||||
* Visit an entire namespace and validate its constraints.
|
||||
*
|
||||
* @param ns The <see cref="Namespace" /> to validate.
|
||||
* @param ns The {@link Namespace} to validate.
|
||||
* @param schemas A map from schema names within the namespace to their schemas.
|
||||
* @param ids A map from schema ids within the namespace to their schemas.
|
||||
*/
|
||||
@@ -174,7 +174,7 @@ HashMap<SchemaId, Schema> ids
|
||||
/**
|
||||
* Visit a single schema and validate its constraints.
|
||||
*
|
||||
* @param s The <see cref="Schema" /> to validate.
|
||||
* @param s The {@link Schema} to validate.
|
||||
* @param schemas A map from schema names within the namespace to their schemas.
|
||||
* @param ids A map from schema ids within the namespace to their schemas.
|
||||
*/
|
||||
@@ -263,7 +263,7 @@ private static void Visit(PropertyType p, PropertyType parent, HashMap<(String,
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate <paramref name="id" /> is a valid <see cref="SchemaId" />.
|
||||
* Validate <paramref name="id" /> is a valid {@link SchemaId}.
|
||||
*
|
||||
* @param id The id to check.
|
||||
* @param label Diagnostic label describing <paramref name="id" />.
|
||||
|
||||
@@ -8,8 +8,8 @@ package com.azure.data.cosmos.serialization.hybridrow.schemas;
|
||||
* Set properties represent an unbounded set of zero or more unique items.
|
||||
* <p>
|
||||
* Sets may be typed or untyped. Within typed sets, all items MUST be the same type. The
|
||||
* type of items is specified via <see cref="Items" />. Typed sets may be stored more efficiently
|
||||
* than untyped sets. When <see cref="Items" /> is unspecified, the set is untyped and its items
|
||||
* type of items is specified via {@link Items}. Typed sets may be stored more efficiently
|
||||
* than untyped sets. When {@link Items} is unspecified, the set is untyped and its items
|
||||
* may be heterogeneous.
|
||||
* <p>
|
||||
* Each item within a set must be unique. Uniqueness is defined by the HybridRow encoded sequence
|
||||
|
||||
@@ -11,7 +11,7 @@ package com.azure.data.cosmos.serialization.hybridrow.schemas;
|
||||
public class StaticKey {
|
||||
/**
|
||||
* The logical path of the referenced property.
|
||||
* Static path MUST refer to properties defined within the same <see cref="Schema" />.
|
||||
* Static path MUST refer to properties defined within the same {@link Schema}.
|
||||
*/
|
||||
// TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes:
|
||||
//ORIGINAL LINE: [JsonProperty(PropertyName = "path", Required = Required.Always)] public string Path {get;set;}
|
||||
|
||||
@@ -13,9 +13,9 @@ public enum StorageKind {
|
||||
/**
|
||||
* The property defines a sparse column.
|
||||
* <p>
|
||||
* Columns marked <see cref="Sparse" /> consume no space in the row when not present. When
|
||||
* Columns marked {@link Sparse} consume no space in the row when not present. When
|
||||
* present they appear in an unordered linked list at the end of the row. Access time for
|
||||
* <see cref="Sparse" /> columns is proportional to the number of <see cref="Sparse" /> columns in the
|
||||
* {@link Sparse} columns is proportional to the number of {@link Sparse} columns in the
|
||||
* row.
|
||||
*/
|
||||
Sparse(0),
|
||||
@@ -35,9 +35,9 @@ public enum StorageKind {
|
||||
* present it will also consume a variable number of bytes to encode the length preceding the actual
|
||||
* value.
|
||||
* <p>
|
||||
* When a <em>long</em> value is marked <see cref="Variable" /> then a null-bit is reserved and
|
||||
* the value is optionally encoded as <see cref="Variable" /> if small enough to fit, otherwise the
|
||||
* null-bit is set and the value is encoded as <see cref="Sparse" />.
|
||||
* When a <em>long</em> value is marked {@link Variable} then a null-bit is reserved and
|
||||
* the value is optionally encoded as {@link Variable} if small enough to fit, otherwise the
|
||||
* null-bit is set and the value is encoded as {@link Sparse}.
|
||||
* </p>
|
||||
*/
|
||||
Variable(2);
|
||||
|
||||
@@ -10,7 +10,7 @@ import java.util.ArrayList;
|
||||
* Tagged properties pair one or more typed values with an API-specific uint8 type code.
|
||||
* <p>
|
||||
* The uint8 type code is implicitly in position 0 within the resulting tagged and should not
|
||||
* be specified in <see cref="Items" />.
|
||||
* be specified in {@link Items}.
|
||||
*/
|
||||
public class TaggedPropertyType extends ScopePropertyType {
|
||||
public static final int MaxTaggedArguments = 2;
|
||||
@@ -21,7 +21,7 @@ public class TaggedPropertyType extends ScopePropertyType {
|
||||
private ArrayList<PropertyType> items;
|
||||
|
||||
/**
|
||||
* Initializes a new instance of the <see cref="TaggedPropertyType" /> class.
|
||||
* Initializes a new instance of the {@link TaggedPropertyType} class.
|
||||
*/
|
||||
public TaggedPropertyType() {
|
||||
this.items = new ArrayList<PropertyType>();
|
||||
|
||||
@@ -16,7 +16,7 @@ public class TuplePropertyType extends ScopePropertyType {
|
||||
private ArrayList<PropertyType> items;
|
||||
|
||||
/**
|
||||
* Initializes a new instance of the <see cref="TuplePropertyType" /> class.
|
||||
* Initializes a new instance of the {@link TuplePropertyType} class.
|
||||
*/
|
||||
public TuplePropertyType() {
|
||||
this.items = new ArrayList<PropertyType>();
|
||||
|
||||
@@ -115,19 +115,19 @@ public enum TypeKind {
|
||||
Float128(15),
|
||||
|
||||
/**
|
||||
* 128-bit floating point value. See <see cref="decimal" />
|
||||
* 128-bit floating point value. See {@link decimal}
|
||||
*/
|
||||
Decimal(16),
|
||||
|
||||
/**
|
||||
* 64-bit date/time value in 100ns increments from C# epoch. See <see cref="System.DateTime" />
|
||||
* 64-bit date/time value in 100ns increments from C# epoch. See {@link System.DateTime}
|
||||
*/
|
||||
// TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes:
|
||||
//ORIGINAL LINE: [EnumMember(Value = "datetime")] DateTime,
|
||||
DateTime(17),
|
||||
|
||||
/**
|
||||
* 64-bit date/time value in milliseconds increments from Unix epoch. See <see cref="UnixDateTime" />
|
||||
* 64-bit date/time value in milliseconds increments from Unix epoch. See {@link UnixDateTime}
|
||||
*/
|
||||
// TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes:
|
||||
//ORIGINAL LINE: [EnumMember(Value = "unixdatetime")] UnixDateTime,
|
||||
@@ -193,7 +193,7 @@ public enum TypeKind {
|
||||
|
||||
/**
|
||||
* An untyped sparse field.
|
||||
* May only be used to define the type within a nested scope (e.g. <see cref="Object"/> or <see cref="Array"/>.
|
||||
* May only be used to define the type within a nested scope (e.g. {@link Object} or {@link Array}.
|
||||
*/
|
||||
Any(30);
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user