mirror of
https://github.com/microsoft/HybridRow.git
synced 2026-01-25 04:13:19 +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/>
|
<site.url/>
|
||||||
<test.groups>unit</test.groups>
|
<test.groups>unit</test.groups>
|
||||||
<javadoc.opts/>
|
<javadoc.opts/>
|
||||||
<guava.version>27.0.1-jre</guava.version>
|
<guava.version>28.0-jre</guava.version>
|
||||||
<jackson.version>2.9.9</jackson.version>
|
<jackson.version>2.9.9</jackson.version>
|
||||||
<mockito.version>1.10.19</mockito.version>
|
<mockito.version>1.10.19</mockito.version>
|
||||||
<mongodb.version>3.11.0</mongodb.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.
|
* @param string The UTF16 encoding string.
|
||||||
* @return A new <see cref="Utf8String" />.
|
* @return A new {@link Utf8String}.
|
||||||
* <p>
|
* <p>
|
||||||
* This method must transcode the UTF-16 into UTF-8 which both requires allocation and is a size of data operation.
|
* 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:
|
//C# TO JAVA CONVERTER WARNING: Java has no equivalent to the C# readonly struct:
|
||||||
public final class Float128 {
|
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);
|
public static final int Size = (Long.SIZE / Byte.SIZE) + (Long.SIZE / Byte.SIZE);
|
||||||
/**
|
/**
|
||||||
@@ -51,7 +51,7 @@ public final class Float128 {
|
|||||||
public long Low;
|
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 high the high-order 64 bits.
|
||||||
* @param low the low-order 64 bits.
|
* @param low the low-order 64 bits.
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ public final class HybridRowHeader {
|
|||||||
private HybridRowVersion Version = HybridRowVersion.values()[0];
|
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 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.
|
* @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> {
|
public final class NullValue implements IEquatable<NullValue> {
|
||||||
/**
|
/**
|
||||||
* The default null literal.
|
* 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();
|
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.
|
* @param other The value to compare against.
|
||||||
* @return True if the two values are the same.
|
* @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
|
@Override
|
||||||
public boolean equals(Object obj) {
|
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
|
@Override
|
||||||
public int hashCode() {
|
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
|
// 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.Layout;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutEndScope;
|
import com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutEndScope;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutScope;
|
import com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutScope;
|
||||||
@@ -30,7 +31,7 @@ public final class RowCursor {
|
|||||||
*/
|
*/
|
||||||
public LayoutType cellType;
|
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();
|
public TypeArgumentList cellTypeArgs = new TypeArgumentList();
|
||||||
/**
|
/**
|
||||||
@@ -102,7 +103,7 @@ public final class RowCursor {
|
|||||||
*/
|
*/
|
||||||
public StringToken writePathToken = new StringToken();
|
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();
|
SchemaId schemaId = row.get().ReadSchemaId(1).clone();
|
||||||
Layout layout = row.get().getResolver().Resolve(schemaId.clone());
|
Layout layout = row.get().getResolver().Resolve(schemaId.clone());
|
||||||
int sparseSegmentOffset = row.get().ComputeVariableValueOffset(layout, HybridRowHeader.Size,
|
int sparseSegmentOffset = row.get().ComputeVariableValueOffset(layout, HybridRowHeader.Size,
|
||||||
@@ -221,7 +222,7 @@ public final class RowCursor {
|
|||||||
LayoutType getScopeType()
|
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:
|
// TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes:
|
||||||
//ORIGINAL LINE: [DebuggerBrowsable(DebuggerBrowsableState.Never)] public TypeArgumentList ScopeTypeArgs
|
//ORIGINAL LINE: [DebuggerBrowsable(DebuggerBrowsableState.Never)] public TypeArgumentList ScopeTypeArgs
|
||||||
|
|||||||
@@ -4,7 +4,8 @@
|
|||||||
|
|
||||||
package com.azure.data.cosmos.serialization.hybridrow;
|
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.LayoutCode;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutEndScope;
|
import com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutEndScope;
|
||||||
|
|
||||||
@@ -14,7 +15,7 @@ public final class RowCursorExtensions {
|
|||||||
/** Makes a copy of the current cursor.
|
/** Makes a copy of the current cursor.
|
||||||
|
|
||||||
The two cursors will have independent and unconnected lifetimes after cloning. However,
|
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:
|
// 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;
|
// edit.writePathToken = pathToken;
|
||||||
// return ref edit;
|
// 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().writePath = null;
|
||||||
edit.get().writePathToken = null;
|
edit.get().writePathToken = null;
|
||||||
return row.get().SparseIteratorMoveNext(edit);
|
return row.get().SparseIteratorMoveNext(edit);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean MoveNext(RefObject<RowCursor> edit, RefObject<RowBuffer> row,
|
public static boolean MoveNext(Reference<RowCursor> edit, Reference<RowBuffer> row,
|
||||||
RefObject<RowCursor> childScope) {
|
Reference<RowCursor> childScope) {
|
||||||
if (childScope.get().scopeType != null) {
|
if (childScope.get().scopeType != null) {
|
||||||
RowCursorExtensions.Skip(edit.get().clone(), row, childScope);
|
RowCursorExtensions.Skip(edit.get().clone(), row, childScope);
|
||||||
}
|
}
|
||||||
@@ -93,7 +94,7 @@ public final class RowCursorExtensions {
|
|||||||
return RowCursorExtensions.MoveNext(edit.get().clone(), row);
|
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);
|
checkState(edit.get().index <= index);
|
||||||
edit.get().writePath = null;
|
edit.get().writePath = null;
|
||||||
edit.get().writePathToken = null;
|
edit.get().writePathToken = null;
|
||||||
@@ -106,8 +107,8 @@ public final class RowCursorExtensions {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Skip(RefObject<RowCursor> edit, RefObject<RowBuffer> row,
|
public static void Skip(Reference<RowCursor> edit, Reference<RowBuffer> row,
|
||||||
RefObject<RowCursor> childScope) {
|
Reference<RowCursor> childScope) {
|
||||||
checkArgument(childScope.get().start == edit.get().valueOffset);
|
checkArgument(childScope.get().start == edit.get().valueOffset);
|
||||||
if (!(childScope.get().cellType instanceof LayoutEndScope)) {
|
if (!(childScope.get().cellType instanceof LayoutEndScope)) {
|
||||||
while (row.get().SparseIteratorMoveNext(childScope)) {
|
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.
|
* Update an existing value or insert a new value, if no value exists.
|
||||||
* <p>
|
* <p>
|
||||||
* If a value exists, then this operation becomes <see cref="Update" />, otherwise it
|
* If a value exists, then this operation becomes {@link Update}, otherwise it
|
||||||
* becomes <see cref="Insert" />.
|
* becomes {@link Insert}.
|
||||||
*/
|
*/
|
||||||
Upsert(3),
|
Upsert(3),
|
||||||
|
|
||||||
@@ -40,7 +40,7 @@ public enum RowOptions {
|
|||||||
* Insert a new value moving existing values to the right.
|
* Insert a new value moving existing values to the right.
|
||||||
* <p>
|
* <p>
|
||||||
* Within an array scope, inserts a new value immediately at the index moving all subsequent
|
* 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),
|
InsertAt(4),
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ public final class SchemaId implements IEquatable<SchemaId> {
|
|||||||
private int Id;
|
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.
|
* @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
|
@Override
|
||||||
public boolean equals(Object obj) {
|
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.
|
* @param other The value to compare against.
|
||||||
* @return True if the two values are the same.
|
* @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
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
@@ -89,7 +89,7 @@ public final class SchemaId implements IEquatable<SchemaId> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <see cref="object.ToString" /> overload.
|
* {@link object.ToString} overload.
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
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 {
|
public static class SchemaIdConverter extends JsonConverter {
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ package com.azure.data.cosmos.serialization.hybridrow;
|
|||||||
/**
|
/**
|
||||||
* A wall clock time expressed in milliseconds since the Unix Epoch.
|
* A wall clock time expressed in milliseconds since the Unix Epoch.
|
||||||
* <p>
|
* <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).
|
* 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:
|
// 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> {
|
public final class UnixDateTime implements IEquatable<UnixDateTime> {
|
||||||
/**
|
/**
|
||||||
* The unix epoch.
|
* 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 />
|
* <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();
|
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);
|
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.
|
* This value may be negative.
|
||||||
*/
|
*/
|
||||||
private long Milliseconds;
|
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() {
|
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.
|
* @param other The value to compare against.
|
||||||
* @return True if the two values are the same.
|
* @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
|
@Override
|
||||||
public boolean equals(Object obj) {
|
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
|
@Override
|
||||||
public int hashCode() {
|
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;
|
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.Result;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.layouts.TypeArgument;
|
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.
|
* @param typeArg The schematized layout type, if a schema is available.
|
||||||
* @return Success if the write is successful, the error code otherwise.
|
* @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;
|
package com.azure.data.cosmos.serialization.hybridrow.io;
|
||||||
|
|
||||||
import com.azure.data.cosmos.core.OutObject;
|
import com.azure.data.cosmos.core.Out;
|
||||||
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.Float128;
|
import com.azure.data.cosmos.serialization.hybridrow.Float128;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.NullValue;
|
import com.azure.data.cosmos.serialization.hybridrow.NullValue;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.Result;
|
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>
|
* <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.
|
* 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
|
* 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.
|
* schematization allowing all fields within the row, both known and unknown, to be read.
|
||||||
* <para />
|
* <para />
|
||||||
* Modifying a <see cref="RowBuffer" /> invalidates any reader or child reader associated with it. In
|
* Modifying a {@link RowBuffer} invalidates any reader or child reader associated with it. In
|
||||||
* general <see cref="RowBuffer" />'s should not be mutated while being enumerated.
|
* 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
|
//C# TO JAVA CONVERTER WARNING: Java does not allow user-defined value types. The behavior of this class may differ
|
||||||
// from the original:
|
// from the original:
|
||||||
//ORIGINAL LINE: public ref struct RowReader
|
//ORIGINAL LINE: public ref struct RowReader
|
||||||
//C# TO JAVA CONVERTER WARNING: Java has no equivalent to the C# ref struct:
|
//C# TO JAVA CONVERTER WARNING: Java has no equivalent to the C# ref struct:
|
||||||
public final class RowReader {
|
public final class RowReader {
|
||||||
|
|
||||||
private int columnIndex;
|
private int columnIndex;
|
||||||
private ReadOnlySpan<LayoutColumn> columns;
|
private ReadOnlySpan<LayoutColumn> columns;
|
||||||
private RowCursor cursor = new RowCursor();
|
private RowCursor cursor = new RowCursor();
|
||||||
@@ -79,35 +81,35 @@ public final class RowReader {
|
|||||||
private States state = States.values()[0];
|
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 row The row to be read.
|
||||||
* @param scope The scope whose fields should be enumerated.
|
* @param scope The scope whose fields should be enumerated.
|
||||||
* <p>
|
* <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
|
* 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.
|
* to process nested content.
|
||||||
*/
|
*/
|
||||||
public RowReader() {
|
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 row The row to be read.
|
||||||
* @param scope The scope whose fields should be enumerated.
|
* @param scope The scope whose fields should be enumerated.
|
||||||
* <p>
|
* <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
|
* 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.
|
* to process nested content.
|
||||||
*/
|
*/
|
||||||
public RowReader(RefObject<RowBuffer> row) {
|
public RowReader(Reference<RowBuffer> row) {
|
||||||
this(row, RowCursor.Create(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.row = row.get().clone();
|
||||||
this.columns = checkpoint.Cursor.layout.getColumns();
|
this.columns = checkpoint.Cursor.layout.getColumns();
|
||||||
this.schematizedCount = checkpoint.Cursor.layout.getNumFixed() + checkpoint.Cursor.layout.getNumVariable();
|
this.schematizedCount = checkpoint.Cursor.layout.getNumFixed() + checkpoint.Cursor.layout.getNumVariable();
|
||||||
@@ -117,7 +119,7 @@ public final class RowReader {
|
|||||||
this.columnIndex = checkpoint.ColumnIndex;
|
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.cursor = scope.clone();
|
||||||
this.row = row.get().clone();
|
this.row = row.get().clone();
|
||||||
this.columns = this.cursor.layout.getColumns();
|
this.columns = this.cursor.layout.getColumns();
|
||||||
@@ -140,16 +142,16 @@ public final class RowReader {
|
|||||||
return true;
|
return true;
|
||||||
case Sparse:
|
case Sparse:
|
||||||
if (this.cursor.cellType instanceof LayoutNullable) {
|
if (this.cursor.cellType instanceof LayoutNullable) {
|
||||||
RefObject<RowCursor> tempRef_cursor =
|
Reference<RowCursor> tempReference_cursor =
|
||||||
new RefObject<RowCursor>(this.cursor);
|
new Reference<RowCursor>(this.cursor);
|
||||||
RowCursor nullableScope = this.row.SparseIteratorReadScope(tempRef_cursor, true).clone();
|
RowCursor nullableScope = this.row.SparseIteratorReadScope(tempReference_cursor, true).clone();
|
||||||
this.cursor = tempRef_cursor.get();
|
this.cursor = tempReference_cursor.get();
|
||||||
RefObject<RowBuffer> tempRef_row =
|
Reference<RowBuffer> tempReference_row =
|
||||||
new RefObject<RowBuffer>(this.row);
|
new Reference<RowBuffer>(this.row);
|
||||||
RefObject<RowCursor> tempRef_nullableScope = new RefObject<RowCursor>(nullableScope);
|
Reference<RowCursor> tempReference_nullableScope = new Reference<RowCursor>(nullableScope);
|
||||||
boolean tempVar = LayoutNullable.HasValue(tempRef_row, tempRef_nullableScope) == Result.Success;
|
boolean tempVar = LayoutNullable.HasValue(tempReference_row, tempReference_nullableScope) == Result.Success;
|
||||||
nullableScope = tempRef_nullableScope.get();
|
nullableScope = tempReference_nullableScope.get();
|
||||||
this.row = tempRef_row.get();
|
this.row = tempReference_row.get();
|
||||||
return tempVar;
|
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
|
* The 0-based index, relative to the start of the scope, of the field (if positioned on a
|
||||||
* field, undefined otherwise).
|
* field, undefined otherwise).
|
||||||
* <p>
|
* <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() {
|
public int getIndex() {
|
||||||
switch (this.state) {
|
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
|
* The path, relative to the scope, of the field (if positioned on a field, undefined
|
||||||
* otherwise).
|
* otherwise).
|
||||||
* <p>
|
* <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() {
|
public UtfAnyString getPath() {
|
||||||
switch (this.state) {
|
switch (this.state) {
|
||||||
@@ -198,10 +200,10 @@ public final class RowReader {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
RefObject<RowCursor> tempRef_cursor =
|
Reference<RowCursor> tempReference_cursor =
|
||||||
new RefObject<RowCursor>(this.cursor);
|
new Reference<RowCursor>(this.cursor);
|
||||||
Utf8Span span = this.row.ReadSparsePath(tempRef_cursor);
|
Utf8Span span = this.row.ReadSparsePath(tempReference_cursor);
|
||||||
this.cursor = tempRef_cursor.get();
|
this.cursor = tempReference_cursor.get();
|
||||||
return Utf8String.CopyFrom(span);
|
return Utf8String.CopyFrom(span);
|
||||||
default:
|
default:
|
||||||
return null;
|
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
|
* The path, relative to the scope, of the field (if positioned on a field, undefined
|
||||||
* otherwise).
|
* otherwise).
|
||||||
* <p>
|
* <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() {
|
public Utf8Span getPathSpan() {
|
||||||
switch (this.state) {
|
switch (this.state) {
|
||||||
case Schematized:
|
case Schematized:
|
||||||
return this.columns[this.columnIndex].Path.Span;
|
return this.columns[this.columnIndex].Path.Span;
|
||||||
case Sparse:
|
case Sparse:
|
||||||
RefObject<RowCursor> tempRef_cursor =
|
Reference<RowCursor> tempReference_cursor =
|
||||||
new RefObject<RowCursor>(this.cursor);
|
new Reference<RowCursor>(this.cursor);
|
||||||
Utf8Span tempVar = this.row.ReadSparsePath(tempRef_cursor);
|
Utf8Span tempVar = this.row.ReadSparsePath(tempReference_cursor);
|
||||||
this.cursor = tempRef_cursor.get();
|
this.cursor = tempReference_cursor.get();
|
||||||
return tempVar;
|
return tempVar;
|
||||||
default:
|
default:
|
||||||
return null;
|
return null;
|
||||||
@@ -314,16 +316,16 @@ public final class RowReader {
|
|||||||
|
|
||||||
case Sparse: {
|
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(),
|
if (!RowCursorExtensions.MoveNext(this.cursor.clone(),
|
||||||
tempRef_row)) {
|
tempReference_row)) {
|
||||||
this.row = tempRef_row.get();
|
this.row = tempReference_row.get();
|
||||||
this.state = States.Done;
|
this.state = States.Done;
|
||||||
// TODO: C# TO JAVA CONVERTER: There is no 'goto' in Java:
|
// TODO: C# TO JAVA CONVERTER: There is no 'goto' in Java:
|
||||||
// goto case States.Done;
|
// goto case States.Done;
|
||||||
} else {
|
} else {
|
||||||
this.row = tempRef_row.get();
|
this.row = tempReference_row.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -345,10 +347,10 @@ public final class RowReader {
|
|||||||
*/
|
*/
|
||||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||||
//ORIGINAL LINE: public Result ReadBinary(out byte[] value)
|
//ORIGINAL LINE: public Result ReadBinary(out byte[] value)
|
||||||
public Result ReadBinary(OutObject<byte[]> value) {
|
public Result ReadBinary(Out<byte[]> value) {
|
||||||
ReadOnlySpan<Byte> span;
|
ReadOnlySpan<Byte> span;
|
||||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
|
// 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:
|
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||||
//ORIGINAL LINE: Result r = this.ReadBinary(out ReadOnlySpan<byte> span);
|
//ORIGINAL LINE: Result r = this.ReadBinary(out ReadOnlySpan<byte> span);
|
||||||
Result r = this.ReadBinary(out 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:
|
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||||
//ORIGINAL LINE: public Result ReadBinary(out ReadOnlySpan<byte> value)
|
//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) {
|
switch (this.state) {
|
||||||
case Schematized:
|
case Schematized:
|
||||||
return this.ReadPrimitiveValue(value);
|
return this.ReadPrimitiveValue(value);
|
||||||
@@ -375,10 +377,10 @@ public final class RowReader {
|
|||||||
return Result.TypeMismatch;
|
return Result.TypeMismatch;
|
||||||
}
|
}
|
||||||
|
|
||||||
RefObject<RowCursor> tempRef_cursor =
|
Reference<RowCursor> tempReference_cursor =
|
||||||
new RefObject<RowCursor>(this.cursor);
|
new Reference<RowCursor>(this.cursor);
|
||||||
value.set(this.row.ReadSparseBinary(tempRef_cursor));
|
value.set(this.row.ReadSparseBinary(tempReference_cursor));
|
||||||
this.cursor = tempRef_cursor.get();
|
this.cursor = tempReference_cursor.get();
|
||||||
return Result.Success;
|
return Result.Success;
|
||||||
default:
|
default:
|
||||||
value.set(null);
|
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.
|
* @param value On success, receives the value, undefined otherwise.
|
||||||
* @return Success if the read is successful, an error code 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) {
|
switch (this.state) {
|
||||||
case Schematized:
|
case Schematized:
|
||||||
return this.ReadPrimitiveValue(value);
|
return this.ReadPrimitiveValue(value);
|
||||||
@@ -402,10 +404,10 @@ public final class RowReader {
|
|||||||
return Result.TypeMismatch;
|
return Result.TypeMismatch;
|
||||||
}
|
}
|
||||||
|
|
||||||
RefObject<RowCursor> tempRef_cursor =
|
Reference<RowCursor> tempReference_cursor =
|
||||||
new RefObject<RowCursor>(this.cursor);
|
new Reference<RowCursor>(this.cursor);
|
||||||
value.set(this.row.ReadSparseBool(tempRef_cursor));
|
value.set(this.row.ReadSparseBool(tempReference_cursor));
|
||||||
this.cursor = tempRef_cursor.get();
|
this.cursor = tempReference_cursor.get();
|
||||||
return Result.Success;
|
return Result.Success;
|
||||||
default:
|
default:
|
||||||
value.set(false);
|
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.
|
* @param value On success, receives the value, undefined otherwise.
|
||||||
* @return Success if the read is successful, an error code 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) {
|
switch (this.state) {
|
||||||
case Schematized:
|
case Schematized:
|
||||||
return this.ReadPrimitiveValue(value);
|
return this.ReadPrimitiveValue(value);
|
||||||
@@ -429,10 +431,10 @@ public final class RowReader {
|
|||||||
return Result.TypeMismatch;
|
return Result.TypeMismatch;
|
||||||
}
|
}
|
||||||
|
|
||||||
RefObject<RowCursor> tempRef_cursor =
|
Reference<RowCursor> tempReference_cursor =
|
||||||
new RefObject<RowCursor>(this.cursor);
|
new Reference<RowCursor>(this.cursor);
|
||||||
value.set(this.row.ReadSparseDateTime(tempRef_cursor));
|
value.set(this.row.ReadSparseDateTime(tempReference_cursor));
|
||||||
this.cursor = tempRef_cursor.get();
|
this.cursor = tempReference_cursor.get();
|
||||||
return Result.Success;
|
return Result.Success;
|
||||||
default:
|
default:
|
||||||
value.set(LocalDateTime.MIN);
|
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.
|
* @param value On success, receives the value, undefined otherwise.
|
||||||
* @return Success if the read is successful, an error code 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) {
|
switch (this.state) {
|
||||||
case Schematized:
|
case Schematized:
|
||||||
return this.ReadPrimitiveValue(value);
|
return this.ReadPrimitiveValue(value);
|
||||||
@@ -456,10 +458,10 @@ public final class RowReader {
|
|||||||
return Result.TypeMismatch;
|
return Result.TypeMismatch;
|
||||||
}
|
}
|
||||||
|
|
||||||
RefObject<RowCursor> tempRef_cursor =
|
Reference<RowCursor> tempReference_cursor =
|
||||||
new RefObject<RowCursor>(this.cursor);
|
new Reference<RowCursor>(this.cursor);
|
||||||
value.set(this.row.ReadSparseDecimal(tempRef_cursor));
|
value.set(this.row.ReadSparseDecimal(tempReference_cursor));
|
||||||
this.cursor = tempRef_cursor.get();
|
this.cursor = tempReference_cursor.get();
|
||||||
return Result.Success;
|
return Result.Success;
|
||||||
default:
|
default:
|
||||||
value.set(new BigDecimal(0));
|
value.set(new BigDecimal(0));
|
||||||
@@ -473,7 +475,7 @@ public final class RowReader {
|
|||||||
* @param value On success, receives the value, undefined otherwise.
|
* @param value On success, receives the value, undefined otherwise.
|
||||||
* @return Success if the read is successful, an error code 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) {
|
switch (this.state) {
|
||||||
case Schematized:
|
case Schematized:
|
||||||
return this.ReadPrimitiveValue(value.clone());
|
return this.ReadPrimitiveValue(value.clone());
|
||||||
@@ -483,10 +485,10 @@ public final class RowReader {
|
|||||||
return Result.TypeMismatch;
|
return Result.TypeMismatch;
|
||||||
}
|
}
|
||||||
|
|
||||||
RefObject<RowCursor> tempRef_cursor =
|
Reference<RowCursor> tempReference_cursor =
|
||||||
new RefObject<RowCursor>(this.cursor);
|
new Reference<RowCursor>(this.cursor);
|
||||||
value.set(this.row.ReadSparseFloat128(tempRef_cursor).clone());
|
value.set(this.row.ReadSparseFloat128(tempReference_cursor).clone());
|
||||||
this.cursor = tempRef_cursor.get();
|
this.cursor = tempReference_cursor.get();
|
||||||
return Result.Success;
|
return Result.Success;
|
||||||
default:
|
default:
|
||||||
value.set(null);
|
value.set(null);
|
||||||
@@ -500,7 +502,7 @@ public final class RowReader {
|
|||||||
* @param value On success, receives the value, undefined otherwise.
|
* @param value On success, receives the value, undefined otherwise.
|
||||||
* @return Success if the read is successful, an error code 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) {
|
switch (this.state) {
|
||||||
case Schematized:
|
case Schematized:
|
||||||
return this.ReadPrimitiveValue(value);
|
return this.ReadPrimitiveValue(value);
|
||||||
@@ -510,10 +512,10 @@ public final class RowReader {
|
|||||||
return Result.TypeMismatch;
|
return Result.TypeMismatch;
|
||||||
}
|
}
|
||||||
|
|
||||||
RefObject<RowCursor> tempRef_cursor =
|
Reference<RowCursor> tempReference_cursor =
|
||||||
new RefObject<RowCursor>(this.cursor);
|
new Reference<RowCursor>(this.cursor);
|
||||||
value.set(this.row.ReadSparseFloat32(tempRef_cursor));
|
value.set(this.row.ReadSparseFloat32(tempReference_cursor));
|
||||||
this.cursor = tempRef_cursor.get();
|
this.cursor = tempReference_cursor.get();
|
||||||
return Result.Success;
|
return Result.Success;
|
||||||
default:
|
default:
|
||||||
value.set(0);
|
value.set(0);
|
||||||
@@ -527,7 +529,7 @@ public final class RowReader {
|
|||||||
* @param value On success, receives the value, undefined otherwise.
|
* @param value On success, receives the value, undefined otherwise.
|
||||||
* @return Success if the read is successful, an error code 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) {
|
switch (this.state) {
|
||||||
case Schematized:
|
case Schematized:
|
||||||
return this.ReadPrimitiveValue(value);
|
return this.ReadPrimitiveValue(value);
|
||||||
@@ -537,10 +539,10 @@ public final class RowReader {
|
|||||||
return Result.TypeMismatch;
|
return Result.TypeMismatch;
|
||||||
}
|
}
|
||||||
|
|
||||||
RefObject<RowCursor> tempRef_cursor =
|
Reference<RowCursor> tempReference_cursor =
|
||||||
new RefObject<RowCursor>(this.cursor);
|
new Reference<RowCursor>(this.cursor);
|
||||||
value.set(this.row.ReadSparseFloat64(tempRef_cursor));
|
value.set(this.row.ReadSparseFloat64(tempReference_cursor));
|
||||||
this.cursor = tempRef_cursor.get();
|
this.cursor = tempReference_cursor.get();
|
||||||
return Result.Success;
|
return Result.Success;
|
||||||
default:
|
default:
|
||||||
value.set(0);
|
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.
|
* @param value On success, receives the value, undefined otherwise.
|
||||||
* @return Success if the read is successful, an error code 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) {
|
switch (this.state) {
|
||||||
case Schematized:
|
case Schematized:
|
||||||
return this.ReadPrimitiveValue(value);
|
return this.ReadPrimitiveValue(value);
|
||||||
@@ -564,10 +566,10 @@ public final class RowReader {
|
|||||||
return Result.TypeMismatch;
|
return Result.TypeMismatch;
|
||||||
}
|
}
|
||||||
|
|
||||||
RefObject<RowCursor> tempRef_cursor =
|
Reference<RowCursor> tempReference_cursor =
|
||||||
new RefObject<RowCursor>(this.cursor);
|
new Reference<RowCursor>(this.cursor);
|
||||||
value.set(this.row.ReadSparseGuid(tempRef_cursor));
|
value.set(this.row.ReadSparseGuid(tempReference_cursor));
|
||||||
this.cursor = tempRef_cursor.get();
|
this.cursor = tempReference_cursor.get();
|
||||||
return Result.Success;
|
return Result.Success;
|
||||||
default:
|
default:
|
||||||
value.set(null);
|
value.set(null);
|
||||||
@@ -581,7 +583,7 @@ public final class RowReader {
|
|||||||
* @param value On success, receives the value, undefined otherwise.
|
* @param value On success, receives the value, undefined otherwise.
|
||||||
* @return Success if the read is successful, an error code 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) {
|
switch (this.state) {
|
||||||
case Schematized:
|
case Schematized:
|
||||||
return this.ReadPrimitiveValue(value);
|
return this.ReadPrimitiveValue(value);
|
||||||
@@ -591,10 +593,10 @@ public final class RowReader {
|
|||||||
return Result.TypeMismatch;
|
return Result.TypeMismatch;
|
||||||
}
|
}
|
||||||
|
|
||||||
RefObject<RowCursor> tempRef_cursor =
|
Reference<RowCursor> tempReference_cursor =
|
||||||
new RefObject<RowCursor>(this.cursor);
|
new Reference<RowCursor>(this.cursor);
|
||||||
value.set(this.row.ReadSparseInt16(tempRef_cursor));
|
value.set(this.row.ReadSparseInt16(tempReference_cursor));
|
||||||
this.cursor = tempRef_cursor.get();
|
this.cursor = tempReference_cursor.get();
|
||||||
return Result.Success;
|
return Result.Success;
|
||||||
default:
|
default:
|
||||||
value.set(0);
|
value.set(0);
|
||||||
@@ -608,7 +610,7 @@ public final class RowReader {
|
|||||||
* @param value On success, receives the value, undefined otherwise.
|
* @param value On success, receives the value, undefined otherwise.
|
||||||
* @return Success if the read is successful, an error code 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) {
|
switch (this.state) {
|
||||||
case Schematized:
|
case Schematized:
|
||||||
return this.ReadPrimitiveValue(value);
|
return this.ReadPrimitiveValue(value);
|
||||||
@@ -618,10 +620,10 @@ public final class RowReader {
|
|||||||
return Result.TypeMismatch;
|
return Result.TypeMismatch;
|
||||||
}
|
}
|
||||||
|
|
||||||
RefObject<RowCursor> tempRef_cursor =
|
Reference<RowCursor> tempReference_cursor =
|
||||||
new RefObject<RowCursor>(this.cursor);
|
new Reference<RowCursor>(this.cursor);
|
||||||
value.set(this.row.ReadSparseInt32(tempRef_cursor));
|
value.set(this.row.ReadSparseInt32(tempReference_cursor));
|
||||||
this.cursor = tempRef_cursor.get();
|
this.cursor = tempReference_cursor.get();
|
||||||
return Result.Success;
|
return Result.Success;
|
||||||
default:
|
default:
|
||||||
value.set(0);
|
value.set(0);
|
||||||
@@ -635,7 +637,7 @@ public final class RowReader {
|
|||||||
* @param value On success, receives the value, undefined otherwise.
|
* @param value On success, receives the value, undefined otherwise.
|
||||||
* @return Success if the read is successful, an error code 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) {
|
switch (this.state) {
|
||||||
case Schematized:
|
case Schematized:
|
||||||
return this.ReadPrimitiveValue(value);
|
return this.ReadPrimitiveValue(value);
|
||||||
@@ -645,10 +647,10 @@ public final class RowReader {
|
|||||||
return Result.TypeMismatch;
|
return Result.TypeMismatch;
|
||||||
}
|
}
|
||||||
|
|
||||||
RefObject<RowCursor> tempRef_cursor =
|
Reference<RowCursor> tempReference_cursor =
|
||||||
new RefObject<RowCursor>(this.cursor);
|
new Reference<RowCursor>(this.cursor);
|
||||||
value.set(this.row.ReadSparseInt64(tempRef_cursor));
|
value.set(this.row.ReadSparseInt64(tempReference_cursor));
|
||||||
this.cursor = tempRef_cursor.get();
|
this.cursor = tempReference_cursor.get();
|
||||||
return Result.Success;
|
return Result.Success;
|
||||||
default:
|
default:
|
||||||
value.set(0);
|
value.set(0);
|
||||||
@@ -662,7 +664,7 @@ public final class RowReader {
|
|||||||
* @param value On success, receives the value, undefined otherwise.
|
* @param value On success, receives the value, undefined otherwise.
|
||||||
* @return Success if the read is successful, an error code 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) {
|
switch (this.state) {
|
||||||
case Schematized:
|
case Schematized:
|
||||||
return this.ReadPrimitiveValue(value);
|
return this.ReadPrimitiveValue(value);
|
||||||
@@ -672,10 +674,10 @@ public final class RowReader {
|
|||||||
return Result.TypeMismatch;
|
return Result.TypeMismatch;
|
||||||
}
|
}
|
||||||
|
|
||||||
RefObject<RowCursor> tempRef_cursor =
|
Reference<RowCursor> tempReference_cursor =
|
||||||
new RefObject<RowCursor>(this.cursor);
|
new Reference<RowCursor>(this.cursor);
|
||||||
value.set(this.row.ReadSparseInt8(tempRef_cursor));
|
value.set(this.row.ReadSparseInt8(tempReference_cursor));
|
||||||
this.cursor = tempRef_cursor.get();
|
this.cursor = tempReference_cursor.get();
|
||||||
return Result.Success;
|
return Result.Success;
|
||||||
default:
|
default:
|
||||||
value.set(0);
|
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.
|
* @param value On success, receives the value, undefined otherwise.
|
||||||
* @return Success if the read is successful, an error code 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) {
|
switch (this.state) {
|
||||||
case Schematized:
|
case Schematized:
|
||||||
return this.ReadPrimitiveValue(value.clone());
|
return this.ReadPrimitiveValue(value.clone());
|
||||||
@@ -699,10 +701,10 @@ public final class RowReader {
|
|||||||
return Result.TypeMismatch;
|
return Result.TypeMismatch;
|
||||||
}
|
}
|
||||||
|
|
||||||
RefObject<RowCursor> tempRef_cursor =
|
Reference<RowCursor> tempReference_cursor =
|
||||||
new RefObject<RowCursor>(this.cursor);
|
new Reference<RowCursor>(this.cursor);
|
||||||
value.set(this.row.ReadSparseMongoDbObjectId(tempRef_cursor).clone());
|
value.set(this.row.ReadSparseMongoDbObjectId(tempReference_cursor).clone());
|
||||||
this.cursor = tempRef_cursor.get();
|
this.cursor = tempReference_cursor.get();
|
||||||
return Result.Success;
|
return Result.Success;
|
||||||
default:
|
default:
|
||||||
value.set(null);
|
value.set(null);
|
||||||
@@ -716,7 +718,7 @@ public final class RowReader {
|
|||||||
* @param value On success, receives the value, undefined otherwise.
|
* @param value On success, receives the value, undefined otherwise.
|
||||||
* @return Success if the read is successful, an error code 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) {
|
switch (this.state) {
|
||||||
case Schematized:
|
case Schematized:
|
||||||
return this.ReadPrimitiveValue(value.clone());
|
return this.ReadPrimitiveValue(value.clone());
|
||||||
@@ -726,10 +728,10 @@ public final class RowReader {
|
|||||||
return Result.TypeMismatch;
|
return Result.TypeMismatch;
|
||||||
}
|
}
|
||||||
|
|
||||||
RefObject<RowCursor> tempRef_cursor =
|
Reference<RowCursor> tempReference_cursor =
|
||||||
new RefObject<RowCursor>(this.cursor);
|
new Reference<RowCursor>(this.cursor);
|
||||||
value.set(this.row.ReadSparseNull(tempRef_cursor).clone());
|
value.set(this.row.ReadSparseNull(tempReference_cursor).clone());
|
||||||
this.cursor = tempRef_cursor.get();
|
this.cursor = tempReference_cursor.get();
|
||||||
return Result.Success;
|
return Result.Success;
|
||||||
default:
|
default:
|
||||||
value.set(null);
|
value.set(null);
|
||||||
@@ -746,15 +748,15 @@ public final class RowReader {
|
|||||||
* Nested child readers are independent of their parent.
|
* Nested child readers are independent of their parent.
|
||||||
*/
|
*/
|
||||||
public RowReader ReadScope() {
|
public RowReader ReadScope() {
|
||||||
RefObject<RowCursor> tempRef_cursor =
|
Reference<RowCursor> tempReference_cursor =
|
||||||
new RefObject<RowCursor>(this.cursor);
|
new Reference<RowCursor>(this.cursor);
|
||||||
RowCursor newScope = this.row.SparseIteratorReadScope(tempRef_cursor, true).clone();
|
RowCursor newScope = this.row.SparseIteratorReadScope(tempReference_cursor, true).clone();
|
||||||
this.cursor = tempRef_cursor.get();
|
this.cursor = tempReference_cursor.get();
|
||||||
RefObject<RowBuffer> tempRef_row =
|
Reference<RowBuffer> tempReference_row =
|
||||||
new RefObject<RowBuffer>(this.row);
|
new Reference<RowBuffer>(this.row);
|
||||||
// TODO: C# TO JAVA CONVERTER: The following line could not be converted:
|
// TODO: C# TO JAVA CONVERTER: The following line could not be converted:
|
||||||
return new RowReader(ref this.row, newScope)
|
return new RowReader(ref this.row, newScope)
|
||||||
this.row = tempRef_row.get();
|
this.row = tempReference_row.get();
|
||||||
return tempVar;
|
return tempVar;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -765,32 +767,32 @@ public final class RowReader {
|
|||||||
* objects, arrays, tuples, set, and maps.
|
* objects, arrays, tuples, set, and maps.
|
||||||
*/
|
*/
|
||||||
public <TContext> Result ReadScope(TContext context, ReaderFunc<TContext> func) {
|
public <TContext> Result ReadScope(TContext context, ReaderFunc<TContext> func) {
|
||||||
RefObject<RowCursor> tempRef_cursor =
|
Reference<RowCursor> tempReference_cursor =
|
||||||
new RefObject<RowCursor>(this.cursor);
|
new Reference<RowCursor>(this.cursor);
|
||||||
RowCursor childScope = this.row.SparseIteratorReadScope(tempRef_cursor, true).clone();
|
RowCursor childScope = this.row.SparseIteratorReadScope(tempReference_cursor, true).clone();
|
||||||
this.cursor = tempRef_cursor.get();
|
this.cursor = tempReference_cursor.get();
|
||||||
RefObject<RowBuffer> tempRef_row =
|
Reference<RowBuffer> tempReference_row =
|
||||||
new RefObject<RowBuffer>(this.row);
|
new Reference<RowBuffer>(this.row);
|
||||||
RowReader nestedReader = new RowReader(tempRef_row, childScope.clone());
|
RowReader nestedReader = new RowReader(tempReference_row, childScope.clone());
|
||||||
this.row = tempRef_row.get();
|
this.row = tempReference_row.get();
|
||||||
|
|
||||||
RefObject<RowReader> tempRef_nestedReader =
|
Reference<RowReader> tempReference_nestedReader =
|
||||||
new RefObject<RowReader>(nestedReader);
|
new Reference<RowReader>(nestedReader);
|
||||||
// TODO: C# TO JAVA CONVERTER: The following line could not be converted:
|
// TODO: C# TO JAVA CONVERTER: The following line could not be converted:
|
||||||
Result result = func == null ? null : func.Invoke(ref nestedReader, context) ??Result.Success;
|
Result result = func == null ? null : func.Invoke(ref nestedReader, context) ??Result.Success;
|
||||||
nestedReader = tempRef_nestedReader.get();
|
nestedReader = tempReference_nestedReader.get();
|
||||||
if (result != Result.Success) {
|
if (result != Result.Success) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
RefObject<RowBuffer> tempRef_row2 =
|
Reference<RowBuffer> tempReference_row2 =
|
||||||
new RefObject<RowBuffer>(this.row);
|
new Reference<RowBuffer>(this.row);
|
||||||
RefObject<RowCursor> tempRef_cursor2 =
|
Reference<RowCursor> tempReference_cursor2 =
|
||||||
new RefObject<RowCursor>(nestedReader.cursor);
|
new Reference<RowCursor>(nestedReader.cursor);
|
||||||
RowCursorExtensions.Skip(this.cursor.clone(), tempRef_row2,
|
RowCursorExtensions.Skip(this.cursor.clone(), tempReference_row2,
|
||||||
tempRef_cursor2);
|
tempReference_cursor2);
|
||||||
nestedReader.cursor = tempRef_cursor2.get();
|
nestedReader.cursor = tempReference_cursor2.get();
|
||||||
this.row = tempRef_row2.get();
|
this.row = tempReference_row2.get();
|
||||||
return Result.Success;
|
return Result.Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -800,10 +802,10 @@ public final class RowReader {
|
|||||||
* @param value On success, receives the value, undefined otherwise.
|
* @param value On success, receives the value, undefined otherwise.
|
||||||
* @return Success if the read is successful, an error code 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;
|
Utf8Span span;
|
||||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
|
// 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);
|
Result r = this.ReadString(out span);
|
||||||
value.set((r == Result.Success) ? span.toString() :)
|
value.set((r == Result.Success) ? span.toString() :)
|
||||||
default
|
default
|
||||||
@@ -816,10 +818,10 @@ public final class RowReader {
|
|||||||
* @param value On success, receives the value, undefined otherwise.
|
* @param value On success, receives the value, undefined otherwise.
|
||||||
* @return Success if the read is successful, an error code 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;
|
Utf8Span span;
|
||||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
|
// 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);
|
Result r = this.ReadString(out span);
|
||||||
value.set((r == Result.Success) ? Utf8String.CopyFrom(span) :)
|
value.set((r == Result.Success) ? Utf8String.CopyFrom(span) :)
|
||||||
default
|
default
|
||||||
@@ -832,7 +834,7 @@ public final class RowReader {
|
|||||||
* @param value On success, receives the value, undefined otherwise.
|
* @param value On success, receives the value, undefined otherwise.
|
||||||
* @return Success if the read is successful, an error code 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) {
|
switch (this.state) {
|
||||||
case Schematized:
|
case Schematized:
|
||||||
return this.ReadPrimitiveValue(value);
|
return this.ReadPrimitiveValue(value);
|
||||||
@@ -842,10 +844,10 @@ public final class RowReader {
|
|||||||
return Result.TypeMismatch;
|
return Result.TypeMismatch;
|
||||||
}
|
}
|
||||||
|
|
||||||
RefObject<RowCursor> tempRef_cursor =
|
Reference<RowCursor> tempReference_cursor =
|
||||||
new RefObject<RowCursor>(this.cursor);
|
new Reference<RowCursor>(this.cursor);
|
||||||
value.set(this.row.ReadSparseString(tempRef_cursor));
|
value.set(this.row.ReadSparseString(tempReference_cursor));
|
||||||
this.cursor = tempRef_cursor.get();
|
this.cursor = tempReference_cursor.get();
|
||||||
return Result.Success;
|
return Result.Success;
|
||||||
default:
|
default:
|
||||||
value.set(null);
|
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:
|
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||||
//ORIGINAL LINE: public Result ReadUInt16(out ushort value)
|
//ORIGINAL LINE: public Result ReadUInt16(out ushort value)
|
||||||
public Result ReadUInt16(OutObject<Short> value) {
|
public Result ReadUInt16(Out<Short> value) {
|
||||||
switch (this.state) {
|
switch (this.state) {
|
||||||
case Schematized:
|
case Schematized:
|
||||||
return this.ReadPrimitiveValue(value);
|
return this.ReadPrimitiveValue(value);
|
||||||
@@ -871,10 +873,10 @@ public final class RowReader {
|
|||||||
return Result.TypeMismatch;
|
return Result.TypeMismatch;
|
||||||
}
|
}
|
||||||
|
|
||||||
RefObject<RowCursor> tempRef_cursor =
|
Reference<RowCursor> tempReference_cursor =
|
||||||
new RefObject<RowCursor>(this.cursor);
|
new Reference<RowCursor>(this.cursor);
|
||||||
value.set(this.row.ReadSparseUInt16(tempRef_cursor));
|
value.set(this.row.ReadSparseUInt16(tempReference_cursor));
|
||||||
this.cursor = tempRef_cursor.get();
|
this.cursor = tempReference_cursor.get();
|
||||||
return Result.Success;
|
return Result.Success;
|
||||||
default:
|
default:
|
||||||
value.set(0);
|
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:
|
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||||
//ORIGINAL LINE: public Result ReadUInt32(out uint value)
|
//ORIGINAL LINE: public Result ReadUInt32(out uint value)
|
||||||
public Result ReadUInt32(OutObject<Integer> value) {
|
public Result ReadUInt32(Out<Integer> value) {
|
||||||
switch (this.state) {
|
switch (this.state) {
|
||||||
case Schematized:
|
case Schematized:
|
||||||
return this.ReadPrimitiveValue(value);
|
return this.ReadPrimitiveValue(value);
|
||||||
@@ -900,10 +902,10 @@ public final class RowReader {
|
|||||||
return Result.TypeMismatch;
|
return Result.TypeMismatch;
|
||||||
}
|
}
|
||||||
|
|
||||||
RefObject<RowCursor> tempRef_cursor =
|
Reference<RowCursor> tempReference_cursor =
|
||||||
new RefObject<RowCursor>(this.cursor);
|
new Reference<RowCursor>(this.cursor);
|
||||||
value.set(this.row.ReadSparseUInt32(tempRef_cursor));
|
value.set(this.row.ReadSparseUInt32(tempReference_cursor));
|
||||||
this.cursor = tempRef_cursor.get();
|
this.cursor = tempReference_cursor.get();
|
||||||
return Result.Success;
|
return Result.Success;
|
||||||
default:
|
default:
|
||||||
value.set(0);
|
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:
|
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||||
//ORIGINAL LINE: public Result ReadUInt64(out ulong value)
|
//ORIGINAL LINE: public Result ReadUInt64(out ulong value)
|
||||||
public Result ReadUInt64(OutObject<Long> value) {
|
public Result ReadUInt64(Out<Long> value) {
|
||||||
switch (this.state) {
|
switch (this.state) {
|
||||||
case Schematized:
|
case Schematized:
|
||||||
return this.ReadPrimitiveValue(value);
|
return this.ReadPrimitiveValue(value);
|
||||||
@@ -929,10 +931,10 @@ public final class RowReader {
|
|||||||
return Result.TypeMismatch;
|
return Result.TypeMismatch;
|
||||||
}
|
}
|
||||||
|
|
||||||
RefObject<RowCursor> tempRef_cursor =
|
Reference<RowCursor> tempReference_cursor =
|
||||||
new RefObject<RowCursor>(this.cursor);
|
new Reference<RowCursor>(this.cursor);
|
||||||
value.set(this.row.ReadSparseUInt64(tempRef_cursor));
|
value.set(this.row.ReadSparseUInt64(tempReference_cursor));
|
||||||
this.cursor = tempRef_cursor.get();
|
this.cursor = tempReference_cursor.get();
|
||||||
return Result.Success;
|
return Result.Success;
|
||||||
default:
|
default:
|
||||||
value.set(0);
|
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:
|
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||||
//ORIGINAL LINE: public Result ReadUInt8(out byte value)
|
//ORIGINAL LINE: public Result ReadUInt8(out byte value)
|
||||||
public Result ReadUInt8(OutObject<Byte> value) {
|
public Result ReadUInt8(Out<Byte> value) {
|
||||||
switch (this.state) {
|
switch (this.state) {
|
||||||
case Schematized:
|
case Schematized:
|
||||||
return this.ReadPrimitiveValue(value);
|
return this.ReadPrimitiveValue(value);
|
||||||
@@ -958,10 +960,10 @@ public final class RowReader {
|
|||||||
return Result.TypeMismatch;
|
return Result.TypeMismatch;
|
||||||
}
|
}
|
||||||
|
|
||||||
RefObject<RowCursor> tempRef_cursor =
|
Reference<RowCursor> tempReference_cursor =
|
||||||
new RefObject<RowCursor>(this.cursor);
|
new Reference<RowCursor>(this.cursor);
|
||||||
value.set(this.row.ReadSparseUInt8(tempRef_cursor));
|
value.set(this.row.ReadSparseUInt8(tempReference_cursor));
|
||||||
this.cursor = tempRef_cursor.get();
|
this.cursor = tempReference_cursor.get();
|
||||||
return Result.Success;
|
return Result.Success;
|
||||||
default:
|
default:
|
||||||
value.set(0);
|
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.
|
* @param value On success, receives the value, undefined otherwise.
|
||||||
* @return Success if the read is successful, an error code 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) {
|
switch (this.state) {
|
||||||
case Schematized:
|
case Schematized:
|
||||||
return this.ReadPrimitiveValue(value.clone());
|
return this.ReadPrimitiveValue(value.clone());
|
||||||
@@ -985,10 +987,10 @@ public final class RowReader {
|
|||||||
return Result.TypeMismatch;
|
return Result.TypeMismatch;
|
||||||
}
|
}
|
||||||
|
|
||||||
RefObject<RowCursor> tempRef_cursor =
|
Reference<RowCursor> tempReference_cursor =
|
||||||
new RefObject<RowCursor>(this.cursor);
|
new Reference<RowCursor>(this.cursor);
|
||||||
value.set(this.row.ReadSparseUnixDateTime(tempRef_cursor).clone());
|
value.set(this.row.ReadSparseUnixDateTime(tempReference_cursor).clone());
|
||||||
this.cursor = tempRef_cursor.get();
|
this.cursor = tempReference_cursor.get();
|
||||||
return Result.Success;
|
return Result.Success;
|
||||||
default:
|
default:
|
||||||
value.set(null);
|
value.set(null);
|
||||||
@@ -1002,7 +1004,7 @@ public final class RowReader {
|
|||||||
* @param value On success, receives the value, undefined otherwise.
|
* @param value On success, receives the value, undefined otherwise.
|
||||||
* @return Success if the read is successful, an error code 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) {
|
switch (this.state) {
|
||||||
case Schematized:
|
case Schematized:
|
||||||
return this.ReadPrimitiveValue(value);
|
return this.ReadPrimitiveValue(value);
|
||||||
@@ -1012,10 +1014,10 @@ public final class RowReader {
|
|||||||
return Result.TypeMismatch;
|
return Result.TypeMismatch;
|
||||||
}
|
}
|
||||||
|
|
||||||
RefObject<RowCursor> tempRef_cursor =
|
Reference<RowCursor> tempReference_cursor =
|
||||||
new RefObject<RowCursor>(this.cursor);
|
new Reference<RowCursor>(this.cursor);
|
||||||
value.set(this.row.ReadSparseVarInt(tempRef_cursor));
|
value.set(this.row.ReadSparseVarInt(tempReference_cursor));
|
||||||
this.cursor = tempRef_cursor.get();
|
this.cursor = tempReference_cursor.get();
|
||||||
return Result.Success;
|
return Result.Success;
|
||||||
default:
|
default:
|
||||||
value.set(0);
|
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:
|
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||||
//ORIGINAL LINE: public Result ReadVarUInt(out ulong value)
|
//ORIGINAL LINE: public Result ReadVarUInt(out ulong value)
|
||||||
public Result ReadVarUInt(OutObject<Long> value) {
|
public Result ReadVarUInt(Out<Long> value) {
|
||||||
switch (this.state) {
|
switch (this.state) {
|
||||||
case Schematized:
|
case Schematized:
|
||||||
return this.ReadPrimitiveValue(value);
|
return this.ReadPrimitiveValue(value);
|
||||||
@@ -1041,10 +1043,10 @@ public final class RowReader {
|
|||||||
return Result.TypeMismatch;
|
return Result.TypeMismatch;
|
||||||
}
|
}
|
||||||
|
|
||||||
RefObject<RowCursor> tempRef_cursor =
|
Reference<RowCursor> tempReference_cursor =
|
||||||
new RefObject<RowCursor>(this.cursor);
|
new Reference<RowCursor>(this.cursor);
|
||||||
value.set(this.row.ReadSparseVarUInt(tempRef_cursor));
|
value.set(this.row.ReadSparseVarUInt(tempReference_cursor));
|
||||||
this.cursor = tempRef_cursor.get();
|
this.cursor = tempReference_cursor.get();
|
||||||
return Result.Success;
|
return Result.Success;
|
||||||
default:
|
default:
|
||||||
value.set(0);
|
value.set(0);
|
||||||
@@ -1062,22 +1064,22 @@ public final class RowReader {
|
|||||||
* <p>
|
* <p>
|
||||||
* <p>
|
* <p>
|
||||||
* The reader must not have been advanced since the child reader was created with ReadScope.
|
* 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
|
* This method can be used when the overload of {@link ReadScope} that takes a
|
||||||
* <see cref="ReaderFunc{TContext}" /> is not an option, such as when TContext is a ref struct.
|
* {@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) {
|
if (nestedReader.get().cursor.start != this.cursor.valueOffset) {
|
||||||
return Result.Failure;
|
return Result.Failure;
|
||||||
}
|
}
|
||||||
|
|
||||||
RefObject<RowBuffer> tempRef_row =
|
Reference<RowBuffer> tempReference_row =
|
||||||
new RefObject<RowBuffer>(this.row);
|
new Reference<RowBuffer>(this.row);
|
||||||
RefObject<RowCursor> tempRef_cursor =
|
Reference<RowCursor> tempReference_cursor =
|
||||||
new RefObject<RowCursor>(nestedReader.get().cursor);
|
new Reference<RowCursor>(nestedReader.get().cursor);
|
||||||
RowCursorExtensions.Skip(this.cursor.clone(), tempRef_row,
|
RowCursorExtensions.Skip(this.cursor.clone(), tempReference_row,
|
||||||
tempRef_cursor);
|
tempReference_cursor);
|
||||||
nestedReader.get().argValue.cursor = tempRef_cursor.get();
|
nestedReader.get().argValue.cursor = tempReference_cursor.get();
|
||||||
this.row = tempRef_row.get();
|
this.row = tempReference_row.get();
|
||||||
return Result.Success;
|
return Result.Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1101,7 +1103,7 @@ public final class RowReader {
|
|||||||
* @param value On success, receives the value, undefined otherwise.
|
* @param value On success, receives the value, undefined otherwise.
|
||||||
* @return Success if the read is successful, an error code 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];
|
LayoutColumn col = this.columns[this.columnIndex];
|
||||||
LayoutType t = this.columns[this.columnIndex].Type;
|
LayoutType t = this.columns[this.columnIndex].Type;
|
||||||
if (!(t instanceof LayoutType<TValue>)) {
|
if (!(t instanceof LayoutType<TValue>)) {
|
||||||
@@ -1111,20 +1113,20 @@ public final class RowReader {
|
|||||||
|
|
||||||
switch (col == null ? null : col.getStorage()) {
|
switch (col == null ? null : col.getStorage()) {
|
||||||
case Fixed:
|
case Fixed:
|
||||||
RefObject<RowBuffer> tempRef_row =
|
Reference<RowBuffer> tempReference_row =
|
||||||
new RefObject<RowBuffer>(this.row);
|
new Reference<RowBuffer>(this.row);
|
||||||
RefObject<RowCursor> tempRef_cursor =
|
Reference<RowCursor> tempReference_cursor =
|
||||||
new RefObject<RowCursor>(this.cursor);
|
new Reference<RowCursor>(this.cursor);
|
||||||
Result tempVar = t.<LayoutType<TValue>>TypeAs().ReadFixed(tempRef_row, tempRef_cursor, col, value);
|
Result tempVar = t.<LayoutType<TValue>>TypeAs().ReadFixed(tempReference_row, tempReference_cursor, col, value);
|
||||||
this.cursor = tempRef_cursor.get();
|
this.cursor = tempReference_cursor.get();
|
||||||
this.row = tempRef_row.get();
|
this.row = tempReference_row.get();
|
||||||
return tempVar;
|
return tempVar;
|
||||||
case Variable:
|
case Variable:
|
||||||
RefObject<RowBuffer> tempRef_row2 = new RefObject<RowBuffer>(this.row);
|
Reference<RowBuffer> tempReference_row2 = new Reference<RowBuffer>(this.row);
|
||||||
RefObject<RowCursor> tempRef_cursor2 = new RefObject<RowCursor>(this.cursor);
|
Reference<RowCursor> tempReference_cursor2 = new Reference<RowCursor>(this.cursor);
|
||||||
Result tempVar2 = t.<LayoutType<TValue>>TypeAs().ReadVariable(tempRef_row2, tempRef_cursor2, col, value);
|
Result tempVar2 = t.<LayoutType<TValue>>TypeAs().ReadVariable(tempReference_row2, tempReference_cursor2, col, value);
|
||||||
this.cursor = tempRef_cursor2.get();
|
this.cursor = tempReference_cursor2.get();
|
||||||
this.row = tempRef_row2.get();
|
this.row = tempReference_row2.get();
|
||||||
return tempVar2;
|
return tempVar2;
|
||||||
default:
|
default:
|
||||||
throw new IllegalStateException();
|
throw new IllegalStateException();
|
||||||
@@ -1139,7 +1141,7 @@ public final class RowReader {
|
|||||||
* @param value On success, receives the value, undefined otherwise.
|
* @param value On success, receives the value, undefined otherwise.
|
||||||
* @return Success if the read is successful, an error code 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];
|
LayoutColumn col = this.columns[this.columnIndex];
|
||||||
LayoutType t = this.columns[this.columnIndex].Type;
|
LayoutType t = this.columns[this.columnIndex].Type;
|
||||||
if (!(t instanceof ILayoutUtf8SpanReadable)) {
|
if (!(t instanceof ILayoutUtf8SpanReadable)) {
|
||||||
@@ -1149,18 +1151,19 @@ public final class RowReader {
|
|||||||
|
|
||||||
switch (col == null ? null : col.getStorage()) {
|
switch (col == null ? null : col.getStorage()) {
|
||||||
case Fixed:
|
case Fixed:
|
||||||
RefObject<RowBuffer> tempRef_row = new RefObject<RowBuffer>(this.row);
|
Reference<RowBuffer> tempReference_row = new Reference<RowBuffer>(this.row);
|
||||||
RefObject<RowCursor> tempRef_cursor = new RefObject<RowCursor>(this.cursor);
|
Reference<RowCursor> tempReference_cursor = new Reference<RowCursor>(this.cursor);
|
||||||
Result tempVar = t.<ILayoutUtf8SpanReadable>TypeAs().ReadFixed(tempRef_row, tempRef_cursor, col, value);
|
Result tempVar = t.<ILayoutUtf8SpanReadable>TypeAs().ReadFixed(tempReference_row, tempReference_cursor, col, value);
|
||||||
this.cursor = tempRef_cursor.get();
|
this.cursor = tempReference_cursor.get();
|
||||||
this.row = tempRef_row.get();
|
this.row = tempReference_row.get();
|
||||||
return tempVar;
|
return tempVar;
|
||||||
case Variable:
|
case Variable:
|
||||||
RefObject<RowBuffer> tempRef_row2 = new RefObject<RowBuffer>(this.row);
|
Reference<RowBuffer> tempReference_row2 = new Reference<RowBuffer>(this.row);
|
||||||
RefObject<RowCursor> tempRef_cursor2 = new RefObject<RowCursor>(this.cursor);
|
Reference<RowCursor> tempReference_cursor2 = new Reference<RowCursor>(this.cursor);
|
||||||
Result tempVar2 = t.<ILayoutUtf8SpanReadable>TypeAs().ReadVariable(tempRef_row2, tempRef_cursor2, col, value);
|
Result tempVar2 = t.<ILayoutUtf8SpanReadable>TypeAs().ReadVariable(tempReference_row2,
|
||||||
this.cursor = tempRef_cursor2.get();
|
tempReference_cursor2, col, value);
|
||||||
this.row = tempRef_row2.get();
|
this.cursor = tempReference_cursor2.get();
|
||||||
|
this.row = tempReference_row2.get();
|
||||||
return tempVar2;
|
return tempVar2;
|
||||||
default:
|
default:
|
||||||
throw new IllegalStateException();
|
throw new IllegalStateException();
|
||||||
@@ -1176,7 +1179,7 @@ public final class RowReader {
|
|||||||
* @param value On success, receives the value, undefined otherwise.
|
* @param value On success, receives the value, undefined otherwise.
|
||||||
* @return Success if the read is successful, an error code 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];
|
LayoutColumn col = this.columns[this.columnIndex];
|
||||||
LayoutType t = this.columns[this.columnIndex].Type;
|
LayoutType t = this.columns[this.columnIndex].Type;
|
||||||
if (!(t instanceof ILayoutSpanReadable<TElement>)) {
|
if (!(t instanceof ILayoutSpanReadable<TElement>)) {
|
||||||
@@ -1186,18 +1189,18 @@ public final class RowReader {
|
|||||||
|
|
||||||
switch (col == null ? null : col.getStorage()) {
|
switch (col == null ? null : col.getStorage()) {
|
||||||
case Fixed:
|
case Fixed:
|
||||||
RefObject<RowBuffer> tempRef_row = new RefObject<RowBuffer>(this.row);
|
Reference<RowBuffer> tempReference_row = new Reference<RowBuffer>(this.row);
|
||||||
RefObject<RowCursor> tempRef_cursor = new RefObject<RowCursor>(this.cursor);
|
Reference<RowCursor> tempReference_cursor = new Reference<RowCursor>(this.cursor);
|
||||||
Result tempVar = t.<ILayoutSpanReadable<TElement>>TypeAs().ReadFixed(tempRef_row, tempRef_cursor, col, value);
|
Result tempVar = t.<ILayoutSpanReadable<TElement>>TypeAs().ReadFixed(tempReference_row, tempReference_cursor, col, value);
|
||||||
this.cursor = tempRef_cursor.get();
|
this.cursor = tempReference_cursor.get();
|
||||||
this.row = tempRef_row.get();
|
this.row = tempReference_row.get();
|
||||||
return tempVar;
|
return tempVar;
|
||||||
case Variable:
|
case Variable:
|
||||||
RefObject<RowBuffer> tempRef_row2 = new RefObject<RowBuffer>(this.row);
|
Reference<RowBuffer> tempReference_row2 = new Reference<RowBuffer>(this.row);
|
||||||
RefObject<RowCursor> tempRef_cursor2 = new RefObject<RowCursor>(this.cursor);
|
Reference<RowCursor> tempReference_cursor2 = new Reference<RowCursor>(this.cursor);
|
||||||
Result tempVar2 = t.<ILayoutSpanReadable<TElement>>TypeAs().ReadVariable(tempRef_row2, tempRef_cursor2, col, value);
|
Result tempVar2 = t.<ILayoutSpanReadable<TElement>>TypeAs().ReadVariable(tempReference_row2, tempReference_cursor2, col, value);
|
||||||
this.cursor = tempRef_cursor2.get();
|
this.cursor = tempReference_cursor2.get();
|
||||||
this.row = tempRef_row2.get();
|
this.row = tempReference_row2.get();
|
||||||
return tempVar2;
|
return tempVar2;
|
||||||
default:
|
default:
|
||||||
throw new IllegalStateException();
|
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>
|
* <typeparam name="TContext">The type of the context value passed by the caller.</typeparam>
|
||||||
*
|
*
|
||||||
* @param reader A forward-only cursor for writing content.
|
* @param reader A forward-only cursor for writing content.
|
||||||
@@ -1253,12 +1256,12 @@ public final class RowReader {
|
|||||||
*/
|
*/
|
||||||
@FunctionalInterface
|
@FunctionalInterface
|
||||||
public interface ReaderFunc<TContext> {
|
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
|
* An encapsulation of the current state of a {@link RowReader} that can be used to
|
||||||
* recreate the <see cref="RowReader" /> in the same logical position.
|
* 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:
|
//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
|
//ORIGINAL LINE: public readonly struct Checkpoint
|
||||||
|
|||||||
@@ -4,8 +4,9 @@
|
|||||||
|
|
||||||
package com.azure.data.cosmos.serialization.hybridrow.io;
|
package com.azure.data.cosmos.serialization.hybridrow.io;
|
||||||
|
|
||||||
import com.azure.data.cosmos.core.OutObject;
|
import com.azure.data.cosmos.core.Out;
|
||||||
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.Result;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -21,13 +22,13 @@ public final class RowReaderExtensions {
|
|||||||
* @param list On success, the collection of materialized items.
|
* @param list On success, the collection of materialized items.
|
||||||
* @return The result.
|
* @return The result.
|
||||||
*/
|
*/
|
||||||
public static <TItem> Result ReadList(RefObject<RowReader> reader, DeserializerFunc<TItem> deserializer,
|
public static <TItem> Result ReadList(Reference<RowReader> reader, DeserializerFunc<TItem> deserializer,
|
||||||
OutObject<ArrayList<TItem>> list) {
|
Out<ArrayList<TItem>> list) {
|
||||||
// Pass the context as a struct by value to avoid allocations.
|
// Pass the context as a struct by value to avoid allocations.
|
||||||
ListContext<TItem> ctx = new ListContext<TItem>();
|
ListContext<TItem> ctx = new ListContext<TItem>();
|
||||||
ctx.List = new ArrayList<>();
|
ctx.List = new ArrayList<>();
|
||||||
ctx.Deserializer =
|
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.
|
// All lambda's here are static.
|
||||||
// TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not
|
// 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()) {
|
while (arrayReader.Read()) {
|
||||||
Result r2 = arrayReader.ReadScope(ctx1.clone(), (ref RowReader itemReader, ListContext<TItem> ctx2) ->
|
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;
|
TItem op;
|
||||||
OutObject<TItem> tempOut_op = new OutObject<TItem>();
|
Out<TItem> tempOut_op = new Out<TItem>();
|
||||||
Result r3 = ctx2.Deserializer.invoke(tempRef_itemReader, tempOut_op);
|
Result r3 = ctx2.Deserializer.invoke(tempReference_itemReader, tempOut_op);
|
||||||
op = tempOut_op.get();
|
op = tempOut_op.get();
|
||||||
itemReader = tempRef_itemReader.get();
|
itemReader = tempReference_itemReader.get();
|
||||||
if (r3 != Result.Success) {
|
if (r3 != Result.Success) {
|
||||||
return r3;
|
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>
|
* <typeparam name="TItem">The type of the item to read.</typeparam>
|
||||||
*
|
*
|
||||||
* @param reader A forward-only cursor for reading the item.
|
* @param reader A forward-only cursor for reading the item.
|
||||||
@@ -78,7 +79,7 @@ public final class RowReaderExtensions {
|
|||||||
*/
|
*/
|
||||||
@FunctionalInterface
|
@FunctionalInterface
|
||||||
public interface DeserializerFunc<TItem> {
|
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
|
//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;
|
package com.azure.data.cosmos.serialization.hybridrow.io;
|
||||||
|
|
||||||
import com.azure.data.cosmos.core.OutObject;
|
import com.azure.data.cosmos.core.Out;
|
||||||
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.Float128;
|
import com.azure.data.cosmos.serialization.hybridrow.Float128;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.NullValue;
|
import com.azure.data.cosmos.serialization.hybridrow.NullValue;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.Result;
|
import com.azure.data.cosmos.serialization.hybridrow.Result;
|
||||||
@@ -33,19 +34,19 @@ public final class RowWriter {
|
|||||||
private RowBuffer row = new RowBuffer();
|
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 row The row to be read.
|
||||||
* @param scope The scope into which items should be written.
|
* @param scope The scope into which items should be written.
|
||||||
* <p>
|
* <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
|
* in a forward only manner. If the root scope is provided then all top-level fields in the row can be
|
||||||
* written.
|
* written.
|
||||||
*/
|
*/
|
||||||
public RowWriter() {
|
public RowWriter() {
|
||||||
}
|
}
|
||||||
|
|
||||||
private RowWriter(RefObject<RowBuffer> row, RefObject<RowCursor> scope) {
|
private RowWriter(Reference<RowBuffer> row, Reference<RowCursor> scope) {
|
||||||
this.row = row.get().clone();
|
this.row = row.get().clone();
|
||||||
this.cursor = scope.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
|
// TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not
|
||||||
// converted by C# to Java Converter:
|
// converted by C# to Java Converter:
|
||||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
|
// 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:
|
//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
|
//ORIGINAL LINE: return this.WritePrimitive(path, value, LayoutType.Binary, (ref RowWriter w, byte[] v) => w
|
||||||
// .row.WriteSparseBinary(ref w.cursor, v, UpdateOptions.Upsert));
|
// .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
|
// TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not
|
||||||
// converted by C# to Java Converter:
|
// converted by C# to Java Converter:
|
||||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
|
// 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:
|
//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,
|
//ORIGINAL LINE: return this.WritePrimitive(path, value, LayoutType.Binary, (ref RowWriter w,
|
||||||
// ReadOnlySpan<byte> v) => w.row.WriteSparseBinary(ref w.cursor, v, UpdateOptions.Upsert));
|
// 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
|
// TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not
|
||||||
// converted by C# to Java Converter:
|
// converted by C# to Java Converter:
|
||||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
|
// 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:
|
//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,
|
//ORIGINAL LINE: return this.WritePrimitive(path, value, LayoutType.Binary, (ref RowWriter w,
|
||||||
// ReadOnlySequence<byte> v) => w.row.WriteSparseBinary(ref w.cursor, v, UpdateOptions.Upsert));
|
// 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 path The scope-relative path of the field to write.
|
||||||
* @param value The value 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
|
// TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not
|
||||||
// converted by C# to Java Converter:
|
// converted by C# to Java Converter:
|
||||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
|
// 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,
|
return this.WritePrimitive(path, value, LayoutType.Boolean,
|
||||||
(ref RowWriter w, boolean v) -> w.row.WriteSparseBool(ref w.cursor, v, UpdateOptions.Upsert));
|
(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.
|
* @param func A function to write the entire row.
|
||||||
* @return Success if the write is successful, an error code otherwise.
|
* @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) {
|
WriterFunc<TContext> func) {
|
||||||
RowCursor scope = RowCursor.Create(row);
|
RowCursor scope = RowCursor.Create(row);
|
||||||
RefObject<RowCursor> tempRef_scope =
|
Reference<RowCursor> tempReference_scope =
|
||||||
new RefObject<RowCursor>(scope);
|
new Reference<RowCursor>(scope);
|
||||||
RowWriter writer = new RowWriter(row, tempRef_scope);
|
RowWriter writer = new RowWriter(row, tempReference_scope);
|
||||||
scope = tempRef_scope.get();
|
scope = tempReference_scope.get();
|
||||||
TypeArgument typeArg = new TypeArgument(LayoutType.UDT,
|
TypeArgument typeArg = new TypeArgument(LayoutType.UDT,
|
||||||
new TypeArgumentList(scope.layout.getSchemaId().clone()));
|
new TypeArgumentList(scope.layout.getSchemaId().clone()));
|
||||||
RefObject<RowWriter> tempRef_writer =
|
Reference<RowWriter> tempReference_writer =
|
||||||
new RefObject<RowWriter>(writer);
|
new Reference<RowWriter>(writer);
|
||||||
// TODO: C# TO JAVA CONVERTER: The following line could not be converted:
|
// TODO: C# TO JAVA CONVERTER: The following line could not be converted:
|
||||||
Result result = func(ref writer, typeArg, context);
|
Result result = func(ref writer, typeArg, context);
|
||||||
writer = tempRef_writer.get();
|
writer = tempReference_writer.get();
|
||||||
row.set(writer.row.clone());
|
row.set(writer.row.clone());
|
||||||
return result;
|
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 path The scope-relative path of the field to write.
|
||||||
* @param value The value 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
|
// TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not
|
||||||
// converted by C# to Java Converter:
|
// converted by C# to Java Converter:
|
||||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
|
// 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,
|
return this.WritePrimitive(path, value, LayoutType.DateTime,
|
||||||
(ref RowWriter w, LocalDateTime v) -> w.row.WriteSparseDateTime(ref w.cursor, v, UpdateOptions.Upsert));
|
(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 path The scope-relative path of the field to write.
|
||||||
* @param value The value 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
|
// TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not
|
||||||
// converted by C# to Java Converter:
|
// converted by C# to Java Converter:
|
||||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
|
// 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,
|
return this.WritePrimitive(path, value, LayoutType.Decimal,
|
||||||
(ref RowWriter w, BigDecimal v) -> w.row.WriteSparseDecimal(ref w.cursor, v, UpdateOptions.Upsert));
|
(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
|
// TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not
|
||||||
// converted by C# to Java Converter:
|
// converted by C# to Java Converter:
|
||||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
|
// 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,
|
return this.WritePrimitive(path, value.clone(), LayoutType.Float128,
|
||||||
(ref RowWriter w, Float128 v) -> w.row.WriteSparseFloat128(ref w.cursor, v.clone(), UpdateOptions.Upsert));
|
(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
|
// TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not
|
||||||
// converted by C# to Java Converter:
|
// converted by C# to Java Converter:
|
||||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
|
// 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,
|
return this.WritePrimitive(path, value, LayoutType.Float32,
|
||||||
(ref RowWriter w, float v) -> w.row.WriteSparseFloat32(ref w.cursor, v, UpdateOptions.Upsert));
|
(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
|
// TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not
|
||||||
// converted by C# to Java Converter:
|
// converted by C# to Java Converter:
|
||||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
|
// 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,
|
return this.WritePrimitive(path, value, LayoutType.Float64,
|
||||||
(ref RowWriter w, double v) -> w.row.WriteSparseFloat64(ref w.cursor, v, UpdateOptions.Upsert));
|
(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 path The scope-relative path of the field to write.
|
||||||
* @param value The value 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
|
// TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not
|
||||||
// converted by C# to Java Converter:
|
// converted by C# to Java Converter:
|
||||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
|
// 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,
|
return this.WritePrimitive(path, value, LayoutType.Guid,
|
||||||
(ref RowWriter w, UUID v) -> w.row.WriteSparseGuid(ref w.cursor, v, UpdateOptions.Upsert));
|
(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
|
// TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not
|
||||||
// converted by C# to Java Converter:
|
// converted by C# to Java Converter:
|
||||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
|
// 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,
|
return this.WritePrimitive(path, value, LayoutType.Int16,
|
||||||
(ref RowWriter w, short v) -> w.row.WriteSparseInt16(ref w.cursor, v, UpdateOptions.Upsert));
|
(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
|
// TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not
|
||||||
// converted by C# to Java Converter:
|
// converted by C# to Java Converter:
|
||||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
|
// 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,
|
return this.WritePrimitive(path, value, LayoutType.Int32,
|
||||||
(ref RowWriter w, int v) -> w.row.WriteSparseInt32(ref w.cursor, v, UpdateOptions.Upsert));
|
(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
|
// TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not
|
||||||
// converted by C# to Java Converter:
|
// converted by C# to Java Converter:
|
||||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
|
// 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,
|
return this.WritePrimitive(path, value, LayoutType.Int64,
|
||||||
(ref RowWriter w, long v) -> w.row.WriteSparseInt64(ref w.cursor, v, UpdateOptions.Upsert));
|
(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
|
// TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not
|
||||||
// converted by C# to Java Converter:
|
// converted by C# to Java Converter:
|
||||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
|
// 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,
|
return this.WritePrimitive(path, value, LayoutType.Int8,
|
||||||
(ref RowWriter w, byte v) -> w.row.WriteSparseInt8(ref w.cursor, v, UpdateOptions.Upsert));
|
(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 path The scope-relative path of the field to write.
|
||||||
* @param value The value 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
|
// TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not
|
||||||
// converted by C# to Java Converter:
|
// converted by C# to Java Converter:
|
||||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
|
// 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,
|
return this.WritePrimitive(path, value.clone(), LayoutType.MongoDbObjectId, (ref RowWriter w,
|
||||||
MongoDbObjectId v) -> w.row.WriteSparseMongoDbObjectId(ref w.cursor, v.clone(), UpdateOptions.Upsert));
|
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.
|
* @param path The scope-relative path of the field to write.
|
||||||
* @return Success if the write is successful, an error code otherwise.
|
* @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
|
// TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not
|
||||||
// converted by C# to Java Converter:
|
// converted by C# to Java Converter:
|
||||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
|
// 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,
|
return this.WritePrimitive(path, NullValue.Default, LayoutType.Null,
|
||||||
(ref RowWriter w, NullValue v) -> w.row.WriteSparseNull(ref w.cursor, v.clone(), UpdateOptions.Upsert));
|
(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:
|
//ORIGINAL LINE: case LayoutObject scopeType:
|
||||||
case LayoutObject
|
case LayoutObject
|
||||||
scopeType:
|
scopeType:
|
||||||
RefObject<RowCursor> tempRef_cursor =
|
Reference<RowCursor> tempReference_cursor =
|
||||||
new RefObject<RowCursor>(this.cursor);
|
new Reference<RowCursor>(this.cursor);
|
||||||
OutObject<RowCursor> tempOut_nestedScope =
|
Out<RowCursor> tempOut_nestedScope =
|
||||||
new OutObject<RowCursor>();
|
new Out<RowCursor>();
|
||||||
this.row.WriteSparseObject(tempRef_cursor, scopeType, UpdateOptions.Upsert, tempOut_nestedScope);
|
this.row.WriteSparseObject(tempRef_cursor, scopeType, UpdateOptions.Upsert, tempOut_nestedScope);
|
||||||
nestedScope = tempOut_nestedScope.get();
|
nestedScope = tempOut_nestedScope.get();
|
||||||
this.cursor = tempRef_cursor.argValue;
|
this.cursor = tempRef_cursor.argValue;
|
||||||
@@ -395,10 +396,10 @@ public final class RowWriter {
|
|||||||
//ORIGINAL LINE: case LayoutArray scopeType:
|
//ORIGINAL LINE: case LayoutArray scopeType:
|
||||||
case LayoutArray
|
case LayoutArray
|
||||||
scopeType:
|
scopeType:
|
||||||
RefObject<RowCursor> tempRef_cursor2 =
|
Reference<RowCursor> tempReference_cursor2 =
|
||||||
new RefObject<RowCursor>(this.cursor);
|
new Reference<RowCursor>(this.cursor);
|
||||||
OutObject<RowCursor> tempOut_nestedScope2 =
|
Out<RowCursor> tempOut_nestedScope2 =
|
||||||
new OutObject<RowCursor>();
|
new Out<RowCursor>();
|
||||||
this.row.WriteSparseArray(tempRef_cursor2, scopeType, UpdateOptions.Upsert, tempOut_nestedScope2);
|
this.row.WriteSparseArray(tempRef_cursor2, scopeType, UpdateOptions.Upsert, tempOut_nestedScope2);
|
||||||
nestedScope = tempOut_nestedScope2.get();
|
nestedScope = tempOut_nestedScope2.get();
|
||||||
this.cursor = tempRef_cursor2.argValue;
|
this.cursor = tempRef_cursor2.argValue;
|
||||||
@@ -407,10 +408,10 @@ public final class RowWriter {
|
|||||||
//ORIGINAL LINE: case LayoutTypedArray scopeType:
|
//ORIGINAL LINE: case LayoutTypedArray scopeType:
|
||||||
case LayoutTypedArray
|
case LayoutTypedArray
|
||||||
scopeType:
|
scopeType:
|
||||||
RefObject<RowCursor> tempRef_cursor3 =
|
Reference<RowCursor> tempReference_cursor3 =
|
||||||
new RefObject<RowCursor>(this.cursor);
|
new Reference<RowCursor>(this.cursor);
|
||||||
OutObject<RowCursor> tempOut_nestedScope3 =
|
Out<RowCursor> tempOut_nestedScope3 =
|
||||||
new OutObject<RowCursor>();
|
new Out<RowCursor>();
|
||||||
this.row.WriteTypedArray(tempRef_cursor3, scopeType, typeArg.getTypeArgs().clone(),
|
this.row.WriteTypedArray(tempRef_cursor3, scopeType, typeArg.getTypeArgs().clone(),
|
||||||
UpdateOptions.Upsert, tempOut_nestedScope3);
|
UpdateOptions.Upsert, tempOut_nestedScope3);
|
||||||
nestedScope = tempOut_nestedScope3.get();
|
nestedScope = tempOut_nestedScope3.get();
|
||||||
@@ -421,10 +422,10 @@ public final class RowWriter {
|
|||||||
//ORIGINAL LINE: case LayoutTuple scopeType:
|
//ORIGINAL LINE: case LayoutTuple scopeType:
|
||||||
case LayoutTuple
|
case LayoutTuple
|
||||||
scopeType:
|
scopeType:
|
||||||
RefObject<RowCursor> tempRef_cursor4 =
|
Reference<RowCursor> tempReference_cursor4 =
|
||||||
new RefObject<RowCursor>(this.cursor);
|
new Reference<RowCursor>(this.cursor);
|
||||||
OutObject<RowCursor> tempOut_nestedScope4 =
|
Out<RowCursor> tempOut_nestedScope4 =
|
||||||
new OutObject<RowCursor>();
|
new Out<RowCursor>();
|
||||||
this.row.WriteSparseTuple(tempRef_cursor4, scopeType, typeArg.getTypeArgs().clone(),
|
this.row.WriteSparseTuple(tempRef_cursor4, scopeType, typeArg.getTypeArgs().clone(),
|
||||||
UpdateOptions.Upsert, tempOut_nestedScope4);
|
UpdateOptions.Upsert, tempOut_nestedScope4);
|
||||||
nestedScope = tempOut_nestedScope4.get();
|
nestedScope = tempOut_nestedScope4.get();
|
||||||
@@ -435,10 +436,10 @@ public final class RowWriter {
|
|||||||
//ORIGINAL LINE: case LayoutTypedTuple scopeType:
|
//ORIGINAL LINE: case LayoutTypedTuple scopeType:
|
||||||
case LayoutTypedTuple
|
case LayoutTypedTuple
|
||||||
scopeType:
|
scopeType:
|
||||||
RefObject<RowCursor> tempRef_cursor5 =
|
Reference<RowCursor> tempReference_cursor5 =
|
||||||
new RefObject<RowCursor>(this.cursor);
|
new Reference<RowCursor>(this.cursor);
|
||||||
OutObject<RowCursor> tempOut_nestedScope5 =
|
Out<RowCursor> tempOut_nestedScope5 =
|
||||||
new OutObject<RowCursor>();
|
new Out<RowCursor>();
|
||||||
this.row.WriteTypedTuple(tempRef_cursor5, scopeType, typeArg.getTypeArgs().clone(),
|
this.row.WriteTypedTuple(tempRef_cursor5, scopeType, typeArg.getTypeArgs().clone(),
|
||||||
UpdateOptions.Upsert, tempOut_nestedScope5);
|
UpdateOptions.Upsert, tempOut_nestedScope5);
|
||||||
nestedScope = tempOut_nestedScope5.get();
|
nestedScope = tempOut_nestedScope5.get();
|
||||||
@@ -449,10 +450,10 @@ public final class RowWriter {
|
|||||||
//ORIGINAL LINE: case LayoutTagged scopeType:
|
//ORIGINAL LINE: case LayoutTagged scopeType:
|
||||||
case LayoutTagged
|
case LayoutTagged
|
||||||
scopeType:
|
scopeType:
|
||||||
RefObject<RowCursor> tempRef_cursor6 =
|
Reference<RowCursor> tempReference_cursor6 =
|
||||||
new RefObject<RowCursor>(this.cursor);
|
new Reference<RowCursor>(this.cursor);
|
||||||
OutObject<RowCursor> tempOut_nestedScope6 =
|
Out<RowCursor> tempOut_nestedScope6 =
|
||||||
new OutObject<RowCursor>();
|
new Out<RowCursor>();
|
||||||
this.row.WriteTypedTuple(tempRef_cursor6, scopeType, typeArg.getTypeArgs().clone(),
|
this.row.WriteTypedTuple(tempRef_cursor6, scopeType, typeArg.getTypeArgs().clone(),
|
||||||
UpdateOptions.Upsert, tempOut_nestedScope6);
|
UpdateOptions.Upsert, tempOut_nestedScope6);
|
||||||
nestedScope = tempOut_nestedScope6.get();
|
nestedScope = tempOut_nestedScope6.get();
|
||||||
@@ -463,10 +464,10 @@ public final class RowWriter {
|
|||||||
//ORIGINAL LINE: case LayoutTagged2 scopeType:
|
//ORIGINAL LINE: case LayoutTagged2 scopeType:
|
||||||
case LayoutTagged2
|
case LayoutTagged2
|
||||||
scopeType:
|
scopeType:
|
||||||
RefObject<RowCursor> tempRef_cursor7 =
|
Reference<RowCursor> tempReference_cursor7 =
|
||||||
new RefObject<RowCursor>(this.cursor);
|
new Reference<RowCursor>(this.cursor);
|
||||||
OutObject<RowCursor> tempOut_nestedScope7 =
|
Out<RowCursor> tempOut_nestedScope7 =
|
||||||
new OutObject<RowCursor>();
|
new Out<RowCursor>();
|
||||||
this.row.WriteTypedTuple(tempRef_cursor7, scopeType, typeArg.getTypeArgs().clone(),
|
this.row.WriteTypedTuple(tempRef_cursor7, scopeType, typeArg.getTypeArgs().clone(),
|
||||||
UpdateOptions.Upsert, tempOut_nestedScope7);
|
UpdateOptions.Upsert, tempOut_nestedScope7);
|
||||||
nestedScope = tempOut_nestedScope7.get();
|
nestedScope = tempOut_nestedScope7.get();
|
||||||
@@ -477,10 +478,10 @@ public final class RowWriter {
|
|||||||
//ORIGINAL LINE: case LayoutNullable scopeType:
|
//ORIGINAL LINE: case LayoutNullable scopeType:
|
||||||
case LayoutNullable
|
case LayoutNullable
|
||||||
scopeType:
|
scopeType:
|
||||||
RefObject<RowCursor> tempRef_cursor8 =
|
Reference<RowCursor> tempReference_cursor8 =
|
||||||
new RefObject<RowCursor>(this.cursor);
|
new Reference<RowCursor>(this.cursor);
|
||||||
OutObject<RowCursor> tempOut_nestedScope8 =
|
Out<RowCursor> tempOut_nestedScope8 =
|
||||||
new OutObject<RowCursor>();
|
new Out<RowCursor>();
|
||||||
this.row.WriteNullable(tempRef_cursor8, scopeType, typeArg.getTypeArgs().clone(),
|
this.row.WriteNullable(tempRef_cursor8, scopeType, typeArg.getTypeArgs().clone(),
|
||||||
UpdateOptions.Upsert, func != null, tempOut_nestedScope8);
|
UpdateOptions.Upsert, func != null, tempOut_nestedScope8);
|
||||||
nestedScope = tempOut_nestedScope8.get();
|
nestedScope = tempOut_nestedScope8.get();
|
||||||
@@ -492,23 +493,23 @@ public final class RowWriter {
|
|||||||
case LayoutUDT
|
case LayoutUDT
|
||||||
scopeType:
|
scopeType:
|
||||||
Layout udt = this.row.getResolver().Resolve(typeArg.getTypeArgs().getSchemaId().clone());
|
Layout udt = this.row.getResolver().Resolve(typeArg.getTypeArgs().getSchemaId().clone());
|
||||||
RefObject<RowCursor> tempRef_cursor9 =
|
Reference<RowCursor> tempReference_cursor9 =
|
||||||
new RefObject<RowCursor>(this.cursor);
|
new Reference<RowCursor>(this.cursor);
|
||||||
OutObject<RowCursor> tempOut_nestedScope9 =
|
Out<RowCursor> tempOut_nestedScope9 =
|
||||||
new OutObject<RowCursor>();
|
new Out<RowCursor>();
|
||||||
this.row.WriteSparseUDT(tempRef_cursor9, scopeType, udt, UpdateOptions.Upsert, tempOut_nestedScope9);
|
this.row.WriteSparseUDT(tempReference_cursor9, scopeType, udt, UpdateOptions.Upsert, tempOut_nestedScope9);
|
||||||
nestedScope = tempOut_nestedScope9.get();
|
nestedScope = tempOut_nestedScope9.get();
|
||||||
this.cursor = tempRef_cursor9.get();
|
this.cursor = tempReference_cursor9.get();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// TODO: C# TO JAVA CONVERTER: Java has no equivalent to C# pattern variables in 'case' statements:
|
// TODO: C# TO JAVA CONVERTER: Java has no equivalent to C# pattern variables in 'case' statements:
|
||||||
//ORIGINAL LINE: case LayoutTypedSet scopeType:
|
//ORIGINAL LINE: case LayoutTypedSet scopeType:
|
||||||
case LayoutTypedSet
|
case LayoutTypedSet
|
||||||
scopeType:
|
scopeType:
|
||||||
RefObject<RowCursor> tempRef_cursor10 =
|
Reference<RowCursor> tempReference_cursor10 =
|
||||||
new RefObject<RowCursor>(this.cursor);
|
new Reference<RowCursor>(this.cursor);
|
||||||
OutObject<RowCursor> tempOut_nestedScope10 =
|
Out<RowCursor> tempOut_nestedScope10 =
|
||||||
new OutObject<RowCursor>();
|
new Out<RowCursor>();
|
||||||
this.row.WriteTypedSet(tempRef_cursor10, scopeType, typeArg.getTypeArgs().clone(),
|
this.row.WriteTypedSet(tempRef_cursor10, scopeType, typeArg.getTypeArgs().clone(),
|
||||||
UpdateOptions.Upsert, tempOut_nestedScope10);
|
UpdateOptions.Upsert, tempOut_nestedScope10);
|
||||||
nestedScope = tempOut_nestedScope10.get();
|
nestedScope = tempOut_nestedScope10.get();
|
||||||
@@ -519,10 +520,10 @@ public final class RowWriter {
|
|||||||
//ORIGINAL LINE: case LayoutTypedMap scopeType:
|
//ORIGINAL LINE: case LayoutTypedMap scopeType:
|
||||||
case LayoutTypedMap
|
case LayoutTypedMap
|
||||||
scopeType:
|
scopeType:
|
||||||
RefObject<RowCursor> tempRef_cursor11 =
|
Reference<RowCursor> tempReference_cursor11 =
|
||||||
new RefObject<RowCursor>(this.cursor);
|
new Reference<RowCursor>(this.cursor);
|
||||||
OutObject<RowCursor> tempOut_nestedScope11 =
|
Out<RowCursor> tempOut_nestedScope11 =
|
||||||
new OutObject<RowCursor>();
|
new Out<RowCursor>();
|
||||||
this.row.WriteTypedMap(tempRef_cursor11, scopeType, typeArg.getTypeArgs().clone(),
|
this.row.WriteTypedMap(tempRef_cursor11, scopeType, typeArg.getTypeArgs().clone(),
|
||||||
UpdateOptions.Upsert, tempOut_nestedScope11);
|
UpdateOptions.Upsert, tempOut_nestedScope11);
|
||||||
nestedScope = tempOut_nestedScope11.get();
|
nestedScope = tempOut_nestedScope11.get();
|
||||||
@@ -534,18 +535,18 @@ public final class RowWriter {
|
|||||||
return Result.Failure;
|
return Result.Failure;
|
||||||
}
|
}
|
||||||
|
|
||||||
RefObject<RowBuffer> tempRef_row =
|
Reference<RowBuffer> tempReference_row =
|
||||||
new RefObject<RowBuffer>(this.row);
|
new Reference<RowBuffer>(this.row);
|
||||||
RefObject<RowCursor> tempRef_nestedScope =
|
Reference<RowCursor> tempReference_nestedScope =
|
||||||
new RefObject<RowCursor>(nestedScope);
|
new Reference<RowCursor>(nestedScope);
|
||||||
RowWriter nestedWriter = new RowWriter(tempRef_row, tempRef_nestedScope);
|
RowWriter nestedWriter = new RowWriter(tempReference_row, tempReference_nestedScope);
|
||||||
nestedScope = tempRef_nestedScope.get();
|
nestedScope = tempReference_nestedScope.get();
|
||||||
this.row = tempRef_row.get();
|
this.row = tempReference_row.get();
|
||||||
RefObject<RowWriter> tempRef_nestedWriter =
|
Reference<RowWriter> tempReference_nestedWriter =
|
||||||
new RefObject<RowWriter>(nestedWriter);
|
new Reference<RowWriter>(nestedWriter);
|
||||||
// TODO: C# TO JAVA CONVERTER: The following line could not be converted:
|
// TODO: C# TO JAVA CONVERTER: The following line could not be converted:
|
||||||
result = func == null ? null : func.Invoke(ref nestedWriter, typeArg, context) ??Result.Success;
|
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();
|
this.row = nestedWriter.row.clone();
|
||||||
nestedScope.count = nestedWriter.cursor.count;
|
nestedScope.count = nestedWriter.cursor.count;
|
||||||
|
|
||||||
@@ -555,24 +556,24 @@ public final class RowWriter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (type instanceof LayoutUniqueScope) {
|
if (type instanceof LayoutUniqueScope) {
|
||||||
RefObject<RowCursor> tempRef_nestedScope2 =
|
Reference<RowCursor> tempReference_nestedScope2 =
|
||||||
new RefObject<RowCursor>(nestedScope);
|
new Reference<RowCursor>(nestedScope);
|
||||||
result = this.row.TypedCollectionUniqueIndexRebuild(tempRef_nestedScope2);
|
result = this.row.TypedCollectionUniqueIndexRebuild(tempReference_nestedScope2);
|
||||||
nestedScope = tempRef_nestedScope2.get();
|
nestedScope = tempReference_nestedScope2.get();
|
||||||
if (result != Result.Success) {
|
if (result != Result.Success) {
|
||||||
// TODO: If the index rebuild fails then the row is corrupted. Should we automatically clean up here?
|
// TODO: If the index rebuild fails then the row is corrupted. Should we automatically clean up here?
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
RefObject<RowBuffer> tempRef_row2 =
|
Reference<RowBuffer> tempReference_row2 =
|
||||||
new RefObject<RowBuffer>(this.row);
|
new Reference<RowBuffer>(this.row);
|
||||||
RefObject<RowCursor> tempRef_cursor12 =
|
Reference<RowCursor> tempReference_cursor12 =
|
||||||
new RefObject<RowCursor>(nestedWriter.cursor);
|
new Reference<RowCursor>(nestedWriter.cursor);
|
||||||
RowCursorExtensions.MoveNext(this.cursor.clone(), tempRef_row2
|
RowCursorExtensions.MoveNext(this.cursor.clone(), tempReference_row2
|
||||||
, tempRef_cursor12);
|
, tempReference_cursor12);
|
||||||
nestedWriter.cursor = tempRef_cursor12.get();
|
nestedWriter.cursor = tempReference_cursor12.get();
|
||||||
this.row = tempRef_row2.get();
|
this.row = tempReference_row2.get();
|
||||||
return Result.Success;
|
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
|
// TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not
|
||||||
// converted by C# to Java Converter:
|
// converted by C# to Java Converter:
|
||||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
|
// 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,
|
return this.WritePrimitive(path, value, LayoutType.Utf8,
|
||||||
(ref RowWriter w, String v) -> w.row.WriteSparseString(ref w.cursor, Utf8Span.TranscodeUtf16(v),
|
(ref RowWriter w, String v) -> w.row.WriteSparseString(ref w.cursor, Utf8Span.TranscodeUtf16(v),
|
||||||
UpdateOptions.Upsert));
|
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
|
// TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not
|
||||||
// converted by C# to Java Converter:
|
// converted by C# to Java Converter:
|
||||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
|
// 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,
|
return this.WritePrimitive(path, value, LayoutType.Utf8,
|
||||||
(ref RowWriter w, Utf8Span v) -> w.row.WriteSparseString(ref w.cursor, v, UpdateOptions.Upsert));
|
(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
|
// TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not
|
||||||
// converted by C# to Java Converter:
|
// converted by C# to Java Converter:
|
||||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
|
// 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:
|
//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
|
//ORIGINAL LINE: return this.WritePrimitive(path, value, LayoutType.UInt16, (ref RowWriter w, ushort v) => w
|
||||||
// .row.WriteSparseUInt16(ref w.cursor, v, UpdateOptions.Upsert));
|
// .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
|
// TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not
|
||||||
// converted by C# to Java Converter:
|
// converted by C# to Java Converter:
|
||||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
|
// 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:
|
//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
|
//ORIGINAL LINE: return this.WritePrimitive(path, value, LayoutType.UInt32, (ref RowWriter w, uint v) => w
|
||||||
// .row.WriteSparseUInt32(ref w.cursor, v, UpdateOptions.Upsert));
|
// .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
|
// TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not
|
||||||
// converted by C# to Java Converter:
|
// converted by C# to Java Converter:
|
||||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
|
// 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:
|
//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
|
//ORIGINAL LINE: return this.WritePrimitive(path, value, LayoutType.UInt64, (ref RowWriter w, ulong v) => w
|
||||||
// .row.WriteSparseUInt64(ref w.cursor, v, UpdateOptions.Upsert));
|
// .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
|
// TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not
|
||||||
// converted by C# to Java Converter:
|
// converted by C# to Java Converter:
|
||||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
|
// 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:
|
//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
|
//ORIGINAL LINE: return this.WritePrimitive(path, value, LayoutType.UInt8, (ref RowWriter w, byte v) => w.row
|
||||||
// .WriteSparseUInt8(ref w.cursor, v, UpdateOptions.Upsert));
|
// .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 path The scope-relative path of the field to write.
|
||||||
* @param value The value 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
|
// TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not
|
||||||
// converted by C# to Java Converter:
|
// converted by C# to Java Converter:
|
||||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
|
// 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,
|
return this.WritePrimitive(path, value.clone(), LayoutType.UnixDateTime,
|
||||||
(ref RowWriter w, UnixDateTime v) -> w.row.WriteSparseUnixDateTime(ref w.cursor, v.clone(),
|
(ref RowWriter w, UnixDateTime v) -> w.row.WriteSparseUnixDateTime(ref w.cursor, v.clone(),
|
||||||
UpdateOptions.Upsert));
|
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
|
// TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not
|
||||||
// converted by C# to Java Converter:
|
// converted by C# to Java Converter:
|
||||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
|
// 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,
|
return this.WritePrimitive(path, value, LayoutType.VarInt,
|
||||||
(ref RowWriter w, long v) -> w.row.WriteSparseVarInt(ref w.cursor, v, UpdateOptions.Upsert));
|
(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
|
// TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not
|
||||||
// converted by C# to Java Converter:
|
// converted by C# to Java Converter:
|
||||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
|
// 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:
|
//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
|
//ORIGINAL LINE: return this.WritePrimitive(path, value, LayoutType.VarUInt, (ref RowWriter w, ulong v) => w
|
||||||
// .row.WriteSparseVarUInt(ref w.cursor, v, UpdateOptions.Upsert));
|
// .row.WriteSparseVarUInt(ref w.cursor, v, UpdateOptions.Upsert));
|
||||||
@@ -769,13 +770,13 @@ public final class RowWriter {
|
|||||||
return Result.TypeConstraint;
|
return Result.TypeConstraint;
|
||||||
}
|
}
|
||||||
} else if (this.cursor.scopeType instanceof LayoutTypedMap) {
|
} else if (this.cursor.scopeType instanceof LayoutTypedMap) {
|
||||||
RefObject<RowCursor> tempRef_cursor =
|
Reference<RowCursor> tempReference_cursor =
|
||||||
new RefObject<RowCursor>(this.cursor);
|
new Reference<RowCursor>(this.cursor);
|
||||||
if (!typeArg.equals(this.cursor.scopeType.<LayoutUniqueScope>TypeAs().FieldType(tempRef_cursor).clone())) {
|
if (!typeArg.equals(this.cursor.scopeType.<LayoutUniqueScope>TypeAs().FieldType(tempReference_cursor).clone())) {
|
||||||
this.cursor = tempRef_cursor.get();
|
this.cursor = tempReference_cursor.get();
|
||||||
return Result.TypeConstraint;
|
return Result.TypeConstraint;
|
||||||
} else {
|
} 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())) {
|
} else if (this.cursor.scopeType.IsTypedScope && !typeArg.equals(this.cursor.scopeTypeArgs.get(0).clone())) {
|
||||||
return Result.TypeConstraint;
|
return Result.TypeConstraint;
|
||||||
@@ -792,7 +793,7 @@ public final class RowWriter {
|
|||||||
* @param path The scope-relative path of the field to write.
|
* @param path The scope-relative path of the field to write.
|
||||||
* @param value The value to write.
|
* @param value The value to write.
|
||||||
* @param type The layout type.
|
* @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.
|
* @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) {
|
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;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
RefObject<RowWriter> tempRef_this =
|
Reference<RowWriter> tempReference_this =
|
||||||
new RefObject<RowWriter>(this);
|
new Reference<RowWriter>(this);
|
||||||
// TODO: C# TO JAVA CONVERTER: The following line could not be converted:
|
// TODO: C# TO JAVA CONVERTER: The following line could not be converted:
|
||||||
sparse(ref this, value)
|
sparse(ref this, value)
|
||||||
this = tempRef_this.get();
|
this = tempReference_this.get();
|
||||||
RefObject<RowBuffer> tempRef_row =
|
Reference<RowBuffer> tempReference_row =
|
||||||
new RefObject<RowBuffer>(this.row);
|
new Reference<RowBuffer>(this.row);
|
||||||
RowCursorExtensions.MoveNext(this.cursor.clone(),
|
RowCursorExtensions.MoveNext(this.cursor.clone(),
|
||||||
tempRef_row);
|
tempReference_row);
|
||||||
this.row = tempRef_row.get();
|
this.row = tempReference_row.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
@@ -831,7 +832,7 @@ public final class RowWriter {
|
|||||||
* @param path The scope-relative path of the field to write.
|
* @param path The scope-relative path of the field to write.
|
||||||
* @param value The value to write.
|
* @param value The value to write.
|
||||||
* @param type The layout type.
|
* @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.
|
* @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) {
|
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;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
RefObject<RowWriter> tempRef_this =
|
Reference<RowWriter> tempReference_this =
|
||||||
new RefObject<RowWriter>(this);
|
new Reference<RowWriter>(this);
|
||||||
// TODO: C# TO JAVA CONVERTER: The following line could not be converted:
|
// TODO: C# TO JAVA CONVERTER: The following line could not be converted:
|
||||||
sparse(ref this, value)
|
sparse(ref this, value)
|
||||||
this = tempRef_this.get();
|
this = tempReference_this.get();
|
||||||
RefObject<RowBuffer> tempRef_row =
|
Reference<RowBuffer> tempReference_row =
|
||||||
new RefObject<RowBuffer>(this.row);
|
new Reference<RowBuffer>(this.row);
|
||||||
RowCursorExtensions.MoveNext(this.cursor.clone(),
|
RowCursorExtensions.MoveNext(this.cursor.clone(),
|
||||||
tempRef_row);
|
tempReference_row);
|
||||||
this.row = tempRef_row.get();
|
this.row = tempReference_row.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
@@ -870,7 +871,7 @@ public final class RowWriter {
|
|||||||
* @param path The scope-relative path of the field to write.
|
* @param path The scope-relative path of the field to write.
|
||||||
* @param value The value to write.
|
* @param value The value to write.
|
||||||
* @param type The layout type.
|
* @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.
|
* @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) {
|
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;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
RefObject<RowWriter> tempRef_this =
|
Reference<RowWriter> tempReference_this =
|
||||||
new RefObject<RowWriter>(this);
|
new Reference<RowWriter>(this);
|
||||||
// TODO: C# TO JAVA CONVERTER: The following line could not be converted:
|
// TODO: C# TO JAVA CONVERTER: The following line could not be converted:
|
||||||
sparse(ref this, value)
|
sparse(ref this, value)
|
||||||
this = tempRef_this.get();
|
this = tempReference_this.get();
|
||||||
RefObject<RowBuffer> tempRef_row =
|
Reference<RowBuffer> tempReference_row =
|
||||||
new RefObject<RowBuffer>(this.row);
|
new Reference<RowBuffer>(this.row);
|
||||||
RowCursorExtensions.MoveNext(this.cursor.clone(),
|
RowCursorExtensions.MoveNext(this.cursor.clone(),
|
||||||
tempRef_row);
|
tempReference_row);
|
||||||
this.row = tempRef_row.get();
|
this.row = tempReference_row.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
@@ -908,7 +909,7 @@ public final class RowWriter {
|
|||||||
* @param path The scope-relative path of the field to write.
|
* @param path The scope-relative path of the field to write.
|
||||||
* @param value The value to write.
|
* @param value The value to write.
|
||||||
* @param type The layout type.
|
* @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.
|
* @return Success if the write is successful, an error code otherwise.
|
||||||
*/
|
*/
|
||||||
private <TValue> Result WritePrimitive(UtfAnyString path, TValue value, LayoutType<TValue> type,
|
private <TValue> Result WritePrimitive(UtfAnyString path, TValue value, LayoutType<TValue> type,
|
||||||
@@ -926,16 +927,16 @@ public final class RowWriter {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
RefObject<RowWriter> tempRef_this =
|
Reference<RowWriter> tempReference_this =
|
||||||
new RefObject<RowWriter>(this);
|
new Reference<RowWriter>(this);
|
||||||
// TODO: C# TO JAVA CONVERTER: The following line could not be converted:
|
// TODO: C# TO JAVA CONVERTER: The following line could not be converted:
|
||||||
sparse(ref this, value)
|
sparse(ref this, value)
|
||||||
this = tempRef_this.get();
|
this = tempReference_this.get();
|
||||||
RefObject<RowBuffer> tempRef_row =
|
Reference<RowBuffer> tempReference_row =
|
||||||
new RefObject<RowBuffer>(this.row);
|
new Reference<RowBuffer>(this.row);
|
||||||
RowCursorExtensions.MoveNext(this.cursor.clone(),
|
RowCursorExtensions.MoveNext(this.cursor.clone(),
|
||||||
tempRef_row);
|
tempReference_row);
|
||||||
this.row = tempRef_row.get();
|
this.row = tempReference_row.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
@@ -952,7 +953,7 @@ public final class RowWriter {
|
|||||||
private <TValue> Result WriteSchematizedValue(UtfAnyString path, TValue value) {
|
private <TValue> Result WriteSchematizedValue(UtfAnyString path, TValue value) {
|
||||||
LayoutColumn col;
|
LayoutColumn col;
|
||||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
|
// 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)) {
|
if (!this.cursor.layout.TryFind(path, out col)) {
|
||||||
return Result.NotFound;
|
return Result.NotFound;
|
||||||
}
|
}
|
||||||
@@ -965,17 +966,17 @@ public final class RowWriter {
|
|||||||
|
|
||||||
switch (col.Storage) {
|
switch (col.Storage) {
|
||||||
case StorageKind.Fixed:
|
case StorageKind.Fixed:
|
||||||
RefObject<RowBuffer> tempRef_row =
|
Reference<RowBuffer> tempReference_row =
|
||||||
new RefObject<RowBuffer>(this.row);
|
new Reference<RowBuffer>(this.row);
|
||||||
Result tempVar2 = t.WriteFixed(ref this.row, ref this.cursor, col, value)
|
Result tempVar2 = t.WriteFixed(ref this.row, ref this.cursor, col, value)
|
||||||
this.row = tempRef_row.get();
|
this.row = tempReference_row.get();
|
||||||
return tempVar2;
|
return tempVar2;
|
||||||
|
|
||||||
case StorageKind.Variable:
|
case StorageKind.Variable:
|
||||||
RefObject<RowBuffer> tempRef_row2 =
|
Reference<RowBuffer> tempReference_row2 =
|
||||||
new RefObject<RowBuffer>(this.row);
|
new Reference<RowBuffer>(this.row);
|
||||||
Result tempVar3 = t.WriteVariable(ref this.row, ref this.cursor, col, value)
|
Result tempVar3 = t.WriteVariable(ref this.row, ref this.cursor, col, value)
|
||||||
this.row = tempRef_row2.get();
|
this.row = tempReference_row2.get();
|
||||||
return tempVar3;
|
return tempVar3;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@@ -995,7 +996,7 @@ public final class RowWriter {
|
|||||||
private Result WriteSchematizedValue(UtfAnyString path, Utf8Span value) {
|
private Result WriteSchematizedValue(UtfAnyString path, Utf8Span value) {
|
||||||
LayoutColumn col;
|
LayoutColumn col;
|
||||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
|
// 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)) {
|
if (!this.cursor.layout.TryFind(path, out col)) {
|
||||||
return Result.NotFound;
|
return Result.NotFound;
|
||||||
}
|
}
|
||||||
@@ -1007,24 +1008,25 @@ public final class RowWriter {
|
|||||||
|
|
||||||
switch (col.Storage) {
|
switch (col.Storage) {
|
||||||
case StorageKind.Fixed:
|
case StorageKind.Fixed:
|
||||||
RefObject<RowBuffer> tempRef_row =
|
Reference<RowBuffer> tempReference_row =
|
||||||
new RefObject<RowBuffer>(this.row);
|
new Reference<RowBuffer>(this.row);
|
||||||
RefObject<RowCursor> tempRef_cursor =
|
Reference<RowCursor> tempReference_cursor =
|
||||||
new RefObject<RowCursor>(this.cursor);
|
new Reference<RowCursor>(this.cursor);
|
||||||
Result tempVar = t.<ILayoutUtf8SpanWritable>TypeAs().WriteFixed(tempRef_row, tempRef_cursor, col,
|
Result tempVar = t.<ILayoutUtf8SpanWritable>TypeAs().WriteFixed(tempReference_row, tempReference_cursor, col,
|
||||||
value);
|
value);
|
||||||
this.cursor = tempRef_cursor.get();
|
this.cursor = tempReference_cursor.get();
|
||||||
this.row = tempRef_row.get();
|
this.row = tempReference_row.get();
|
||||||
return tempVar;
|
return tempVar;
|
||||||
case StorageKind.Variable:
|
case StorageKind.Variable:
|
||||||
RefObject<RowBuffer> tempRef_row2 =
|
Reference<RowBuffer> tempReference_row2 =
|
||||||
new RefObject<RowBuffer>(this.row);
|
new Reference<RowBuffer>(this.row);
|
||||||
RefObject<RowCursor> tempRef_cursor2 =
|
Reference<RowCursor> tempReference_cursor2 =
|
||||||
new RefObject<RowCursor>(this.cursor);
|
new Reference<RowCursor>(this.cursor);
|
||||||
Result tempVar2 = t.<ILayoutUtf8SpanWritable>TypeAs().WriteVariable(tempRef_row2, tempRef_cursor2,
|
Result tempVar2 = t.<ILayoutUtf8SpanWritable>TypeAs().WriteVariable(tempReference_row2,
|
||||||
|
tempReference_cursor2,
|
||||||
col, value);
|
col, value);
|
||||||
this.cursor = tempRef_cursor2.get();
|
this.cursor = tempReference_cursor2.get();
|
||||||
this.row = tempRef_row2.get();
|
this.row = tempReference_row2.get();
|
||||||
return tempVar2;
|
return tempVar2;
|
||||||
default:
|
default:
|
||||||
return Result.NotFound;
|
return Result.NotFound;
|
||||||
@@ -1041,7 +1043,7 @@ public final class RowWriter {
|
|||||||
*/
|
*/
|
||||||
private <TElement> Result WriteSchematizedValue(UtfAnyString path, ReadOnlySpan<TElement> value) {
|
private <TElement> Result WriteSchematizedValue(UtfAnyString path, ReadOnlySpan<TElement> value) {
|
||||||
LayoutColumn col;
|
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)) {
|
if (!this.cursor.layout.TryFind(path, out col)) {
|
||||||
return Result.NotFound;
|
return Result.NotFound;
|
||||||
}
|
}
|
||||||
@@ -1053,18 +1055,18 @@ public final class RowWriter {
|
|||||||
|
|
||||||
switch (col.Storage) {
|
switch (col.Storage) {
|
||||||
case StorageKind.Fixed:
|
case StorageKind.Fixed:
|
||||||
RefObject<RowBuffer> tempRef_row = new RefObject<RowBuffer>(this.row);
|
Reference<RowBuffer> tempReference_row = new Reference<RowBuffer>(this.row);
|
||||||
RefObject<RowCursor> tempRef_cursor = new RefObject<RowCursor>(this.cursor);
|
Reference<RowCursor> tempReference_cursor = new Reference<RowCursor>(this.cursor);
|
||||||
Result tempVar = t.<ILayoutSpanWritable<TElement>>TypeAs().WriteFixed(tempRef_row, tempRef_cursor, col, value);
|
Result tempVar = t.<ILayoutSpanWritable<TElement>>TypeAs().WriteFixed(tempReference_row, tempReference_cursor, col, value);
|
||||||
this.cursor = tempRef_cursor.get();
|
this.cursor = tempReference_cursor.get();
|
||||||
this.row = tempRef_row.get();
|
this.row = tempReference_row.get();
|
||||||
return tempVar;
|
return tempVar;
|
||||||
case StorageKind.Variable:
|
case StorageKind.Variable:
|
||||||
RefObject<RowBuffer> tempRef_row2 = new RefObject<RowBuffer>(this.row);
|
Reference<RowBuffer> tempReference_row2 = new Reference<RowBuffer>(this.row);
|
||||||
RefObject<RowCursor> tempRef_cursor2 = new RefObject<RowCursor>(this.cursor);
|
Reference<RowCursor> tempReference_cursor2 = new Reference<RowCursor>(this.cursor);
|
||||||
Result tempVar2 = t.<ILayoutSpanWritable<TElement>>TypeAs().WriteVariable(tempRef_row2, tempRef_cursor2, col, value);
|
Result tempVar2 = t.<ILayoutSpanWritable<TElement>>TypeAs().WriteVariable(tempReference_row2, tempReference_cursor2, col, value);
|
||||||
this.cursor = tempRef_cursor2.get();
|
this.cursor = tempReference_cursor2.get();
|
||||||
this.row = tempRef_row2.get();
|
this.row = tempReference_row2.get();
|
||||||
return tempVar2;
|
return tempVar2;
|
||||||
default:
|
default:
|
||||||
return Result.NotFound;
|
return Result.NotFound;
|
||||||
@@ -1081,7 +1083,7 @@ public final class RowWriter {
|
|||||||
*/
|
*/
|
||||||
private <TElement> Result WriteSchematizedValue(UtfAnyString path, ReadOnlySequence<TElement> value) {
|
private <TElement> Result WriteSchematizedValue(UtfAnyString path, ReadOnlySequence<TElement> value) {
|
||||||
LayoutColumn col;
|
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)) {
|
if (!this.cursor.layout.TryFind(path, out col)) {
|
||||||
return Result.NotFound;
|
return Result.NotFound;
|
||||||
}
|
}
|
||||||
@@ -1093,18 +1095,18 @@ public final class RowWriter {
|
|||||||
|
|
||||||
switch (col.Storage) {
|
switch (col.Storage) {
|
||||||
case StorageKind.Fixed:
|
case StorageKind.Fixed:
|
||||||
RefObject<RowBuffer> tempRef_row = new RefObject<RowBuffer>(this.row);
|
Reference<RowBuffer> tempReference_row = new Reference<RowBuffer>(this.row);
|
||||||
RefObject<RowCursor> tempRef_cursor = new RefObject<RowCursor>(this.cursor);
|
Reference<RowCursor> tempReference_cursor = new Reference<RowCursor>(this.cursor);
|
||||||
Result tempVar = t.<ILayoutSequenceWritable<TElement>>TypeAs().WriteFixed(tempRef_row, tempRef_cursor, col, value);
|
Result tempVar = t.<ILayoutSequenceWritable<TElement>>TypeAs().WriteFixed(tempReference_row, tempReference_cursor, col, value);
|
||||||
this.cursor = tempRef_cursor.get();
|
this.cursor = tempReference_cursor.get();
|
||||||
this.row = tempRef_row.get();
|
this.row = tempReference_row.get();
|
||||||
return tempVar;
|
return tempVar;
|
||||||
case StorageKind.Variable:
|
case StorageKind.Variable:
|
||||||
RefObject<RowBuffer> tempRef_row2 = new RefObject<RowBuffer>(this.row);
|
Reference<RowBuffer> tempReference_row2 = new Reference<RowBuffer>(this.row);
|
||||||
RefObject<RowCursor> tempRef_cursor2 = new RefObject<RowCursor>(this.cursor);
|
Reference<RowCursor> tempReference_cursor2 = new Reference<RowCursor>(this.cursor);
|
||||||
Result tempVar2 = t.<ILayoutSequenceWritable<TElement>>TypeAs().WriteVariable(tempRef_row2, tempRef_cursor2, col, value);
|
Result tempVar2 = t.<ILayoutSequenceWritable<TElement>>TypeAs().WriteVariable(tempReference_row2, tempReference_cursor2, col, value);
|
||||||
this.cursor = tempRef_cursor2.get();
|
this.cursor = tempReference_cursor2.get();
|
||||||
this.row = tempRef_row2.get();
|
this.row = tempReference_row2.get();
|
||||||
return tempVar2;
|
return tempVar2;
|
||||||
default:
|
default:
|
||||||
return Result.NotFound;
|
return Result.NotFound;
|
||||||
@@ -1113,21 +1115,21 @@ public final class RowWriter {
|
|||||||
|
|
||||||
@FunctionalInterface
|
@FunctionalInterface
|
||||||
private interface AccessMethod<TValue> {
|
private interface AccessMethod<TValue> {
|
||||||
void invoke(RefObject<RowWriter> writer, TValue value);
|
void invoke(Reference<RowWriter> writer, TValue value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@FunctionalInterface
|
@FunctionalInterface
|
||||||
private interface AccessReadOnlySpanMethod<T> {
|
private interface AccessReadOnlySpanMethod<T> {
|
||||||
void invoke(RefObject<RowWriter> writer, ReadOnlySpan value);
|
void invoke(Reference<RowWriter> writer, ReadOnlySpan value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@FunctionalInterface
|
@FunctionalInterface
|
||||||
private interface AccessUtf8SpanMethod {
|
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>
|
* <typeparam name="TContext">The type of the context value passed by the caller.</typeparam>
|
||||||
*
|
*
|
||||||
* @param writer A forward-only cursor for writing content.
|
* @param writer A forward-only cursor for writing content.
|
||||||
@@ -1137,6 +1139,6 @@ public final class RowWriter {
|
|||||||
*/
|
*/
|
||||||
@FunctionalInterface
|
@FunctionalInterface
|
||||||
public interface WriterFunc<TContext> {
|
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;
|
package com.azure.data.cosmos.serialization.hybridrow.json;
|
||||||
|
|
||||||
import com.azure.data.cosmos.core.OutObject;
|
import com.azure.data.cosmos.core.Out;
|
||||||
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.Float128;
|
import com.azure.data.cosmos.serialization.hybridrow.Float128;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.NullValue;
|
import com.azure.data.cosmos.serialization.hybridrow.NullValue;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.Result;
|
import com.azure.data.cosmos.serialization.hybridrow.Result;
|
||||||
@@ -16,26 +17,26 @@ import java.util.UUID;
|
|||||||
|
|
||||||
public final class RowReaderJsonExtensions {
|
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 reader The reader to project to JSON.
|
||||||
* @param str If successful, the JSON document that corresponds to the <paramref name="reader"/>.
|
* @param str If successful, the JSON document that corresponds to the <paramref name="reader"/>.
|
||||||
* @return The result.
|
* @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);
|
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 reader The reader to project to JSON.
|
||||||
* @param settings Settings that control how the JSON document is formatted.
|
* @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"/>.
|
* @param str If successful, the JSON document that corresponds to the <paramref name="reader"/>.
|
||||||
* @return The result.
|
* @return The result.
|
||||||
*/
|
*/
|
||||||
public static Result ToJson(RefObject<RowReader> reader, RowReaderJsonSettings settings,
|
public static Result ToJson(Reference<RowReader> reader, RowReaderJsonSettings settings,
|
||||||
OutObject<String> str) {
|
Out<String> str) {
|
||||||
ReaderStringContext ctx = new ReaderStringContext(new StringBuilder(),
|
ReaderStringContext ctx = new ReaderStringContext(new StringBuilder(),
|
||||||
new RowReaderJsonSettings(settings.IndentChars, settings.QuoteChar == '\'' ? '\'' : '"'), 1);
|
new RowReaderJsonSettings(settings.IndentChars, settings.QuoteChar == '\'' ? '\'' : '"'), 1);
|
||||||
|
|
||||||
@@ -52,7 +53,7 @@ public final class RowReaderJsonExtensions {
|
|||||||
return Result.Success;
|
return Result.Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Result ToJson(RefObject<RowReader> reader, ReaderStringContext ctx) {
|
private static Result ToJson(Reference<RowReader> reader, ReaderStringContext ctx) {
|
||||||
int index = 0;
|
int index = 0;
|
||||||
while (reader.get().Read()) {
|
while (reader.get().Read()) {
|
||||||
String path = !reader.get().getPath().IsNull ? String.format("%1$s%2$s%3$s:", ctx.Settings.QuoteChar,
|
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) {
|
switch (reader.get().getType().LayoutCode) {
|
||||||
case Null: {
|
case Null: {
|
||||||
NullValue _;
|
NullValue _;
|
||||||
OutObject<NullValue> tempOut__ =
|
Out<NullValue> tempOut__ =
|
||||||
new OutObject<NullValue>();
|
new Out<NullValue>();
|
||||||
r = reader.get().ReadNull(tempOut__);
|
r = reader.get().ReadNull(tempOut__);
|
||||||
_ = tempOut__.get();
|
_ = tempOut__.get();
|
||||||
if (r != Result.Success) {
|
if (r != Result.Success) {
|
||||||
@@ -89,7 +90,7 @@ public final class RowReaderJsonExtensions {
|
|||||||
|
|
||||||
case Boolean: {
|
case Boolean: {
|
||||||
boolean value;
|
boolean value;
|
||||||
OutObject<Boolean> tempOut_value = new OutObject<Boolean>();
|
Out<Boolean> tempOut_value = new Out<Boolean>();
|
||||||
r = reader.get().ReadBool(tempOut_value);
|
r = reader.get().ReadBool(tempOut_value);
|
||||||
value = tempOut_value.get();
|
value = tempOut_value.get();
|
||||||
if (r != Result.Success) {
|
if (r != Result.Success) {
|
||||||
@@ -102,7 +103,7 @@ public final class RowReaderJsonExtensions {
|
|||||||
|
|
||||||
case Int8: {
|
case Int8: {
|
||||||
byte value;
|
byte value;
|
||||||
OutObject<Byte> tempOut_value2 = new OutObject<Byte>();
|
Out<Byte> tempOut_value2 = new Out<Byte>();
|
||||||
r = reader.get().ReadInt8(tempOut_value2);
|
r = reader.get().ReadInt8(tempOut_value2);
|
||||||
value = tempOut_value2.get();
|
value = tempOut_value2.get();
|
||||||
if (r != Result.Success) {
|
if (r != Result.Success) {
|
||||||
@@ -115,7 +116,7 @@ public final class RowReaderJsonExtensions {
|
|||||||
|
|
||||||
case Int16: {
|
case Int16: {
|
||||||
short value;
|
short value;
|
||||||
OutObject<Short> tempOut_value3 = new OutObject<Short>();
|
Out<Short> tempOut_value3 = new Out<Short>();
|
||||||
r = reader.get().ReadInt16(tempOut_value3);
|
r = reader.get().ReadInt16(tempOut_value3);
|
||||||
value = tempOut_value3.get();
|
value = tempOut_value3.get();
|
||||||
if (r != Result.Success) {
|
if (r != Result.Success) {
|
||||||
@@ -128,7 +129,7 @@ public final class RowReaderJsonExtensions {
|
|||||||
|
|
||||||
case Int32: {
|
case Int32: {
|
||||||
int value;
|
int value;
|
||||||
OutObject<Integer> tempOut_value4 = new OutObject<Integer>();
|
Out<Integer> tempOut_value4 = new Out<Integer>();
|
||||||
r = reader.get().ReadInt32(tempOut_value4);
|
r = reader.get().ReadInt32(tempOut_value4);
|
||||||
value = tempOut_value4.get();
|
value = tempOut_value4.get();
|
||||||
if (r != Result.Success) {
|
if (r != Result.Success) {
|
||||||
@@ -141,7 +142,7 @@ public final class RowReaderJsonExtensions {
|
|||||||
|
|
||||||
case Int64: {
|
case Int64: {
|
||||||
long value;
|
long value;
|
||||||
OutObject<Long> tempOut_value5 = new OutObject<Long>();
|
Out<Long> tempOut_value5 = new Out<Long>();
|
||||||
r = reader.get().ReadInt64(tempOut_value5);
|
r = reader.get().ReadInt64(tempOut_value5);
|
||||||
value = tempOut_value5.get();
|
value = tempOut_value5.get();
|
||||||
if (r != Result.Success) {
|
if (r != Result.Success) {
|
||||||
@@ -154,7 +155,7 @@ public final class RowReaderJsonExtensions {
|
|||||||
|
|
||||||
case UInt8: {
|
case UInt8: {
|
||||||
byte value;
|
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:
|
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||||
//ORIGINAL LINE: r = reader.ReadUInt8(out byte value);
|
//ORIGINAL LINE: r = reader.ReadUInt8(out byte value);
|
||||||
r = reader.get().ReadUInt8(tempOut_value6);
|
r = reader.get().ReadUInt8(tempOut_value6);
|
||||||
@@ -169,7 +170,7 @@ public final class RowReaderJsonExtensions {
|
|||||||
|
|
||||||
case UInt16: {
|
case UInt16: {
|
||||||
short value;
|
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:
|
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||||
//ORIGINAL LINE: r = reader.ReadUInt16(out ushort value);
|
//ORIGINAL LINE: r = reader.ReadUInt16(out ushort value);
|
||||||
r = reader.get().ReadUInt16(tempOut_value7);
|
r = reader.get().ReadUInt16(tempOut_value7);
|
||||||
@@ -184,7 +185,7 @@ public final class RowReaderJsonExtensions {
|
|||||||
|
|
||||||
case UInt32: {
|
case UInt32: {
|
||||||
int value;
|
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:
|
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||||
//ORIGINAL LINE: r = reader.ReadUInt32(out uint value);
|
//ORIGINAL LINE: r = reader.ReadUInt32(out uint value);
|
||||||
r = reader.get().ReadUInt32(tempOut_value8);
|
r = reader.get().ReadUInt32(tempOut_value8);
|
||||||
@@ -199,7 +200,7 @@ public final class RowReaderJsonExtensions {
|
|||||||
|
|
||||||
case UInt64: {
|
case UInt64: {
|
||||||
long value;
|
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:
|
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||||
//ORIGINAL LINE: r = reader.ReadUInt64(out ulong value);
|
//ORIGINAL LINE: r = reader.ReadUInt64(out ulong value);
|
||||||
r = reader.get().ReadUInt64(tempOut_value9);
|
r = reader.get().ReadUInt64(tempOut_value9);
|
||||||
@@ -214,7 +215,7 @@ public final class RowReaderJsonExtensions {
|
|||||||
|
|
||||||
case VarInt: {
|
case VarInt: {
|
||||||
long value;
|
long value;
|
||||||
OutObject<Long> tempOut_value10 = new OutObject<Long>();
|
Out<Long> tempOut_value10 = new Out<Long>();
|
||||||
r = reader.get().ReadVarInt(tempOut_value10);
|
r = reader.get().ReadVarInt(tempOut_value10);
|
||||||
value = tempOut_value10.get();
|
value = tempOut_value10.get();
|
||||||
if (r != Result.Success) {
|
if (r != Result.Success) {
|
||||||
@@ -227,7 +228,7 @@ public final class RowReaderJsonExtensions {
|
|||||||
|
|
||||||
case VarUInt: {
|
case VarUInt: {
|
||||||
long value;
|
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:
|
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||||
//ORIGINAL LINE: r = reader.ReadVarUInt(out ulong value);
|
//ORIGINAL LINE: r = reader.ReadVarUInt(out ulong value);
|
||||||
r = reader.get().ReadVarUInt(tempOut_value11);
|
r = reader.get().ReadVarUInt(tempOut_value11);
|
||||||
@@ -242,7 +243,7 @@ public final class RowReaderJsonExtensions {
|
|||||||
|
|
||||||
case Float32: {
|
case Float32: {
|
||||||
float value;
|
float value;
|
||||||
OutObject<Float> tempOut_value12 = new OutObject<Float>();
|
Out<Float> tempOut_value12 = new Out<Float>();
|
||||||
r = reader.get().ReadFloat32(tempOut_value12);
|
r = reader.get().ReadFloat32(tempOut_value12);
|
||||||
value = tempOut_value12.get();
|
value = tempOut_value12.get();
|
||||||
if (r != Result.Success) {
|
if (r != Result.Success) {
|
||||||
@@ -255,7 +256,7 @@ public final class RowReaderJsonExtensions {
|
|||||||
|
|
||||||
case Float64: {
|
case Float64: {
|
||||||
double value;
|
double value;
|
||||||
OutObject<Double> tempOut_value13 = new OutObject<Double>();
|
Out<Double> tempOut_value13 = new Out<Double>();
|
||||||
r = reader.get().ReadFloat64(tempOut_value13);
|
r = reader.get().ReadFloat64(tempOut_value13);
|
||||||
value = tempOut_value13.get();
|
value = tempOut_value13.get();
|
||||||
if (r != Result.Success) {
|
if (r != Result.Success) {
|
||||||
@@ -268,8 +269,8 @@ public final class RowReaderJsonExtensions {
|
|||||||
|
|
||||||
case Float128: {
|
case Float128: {
|
||||||
Float128 _;
|
Float128 _;
|
||||||
OutObject<Float128> tempOut__2 =
|
Out<Float128> tempOut__2 =
|
||||||
new OutObject<Float128>();
|
new Out<Float128>();
|
||||||
r = reader.get().ReadFloat128(tempOut__2);
|
r = reader.get().ReadFloat128(tempOut__2);
|
||||||
_ = tempOut__2.get();
|
_ = tempOut__2.get();
|
||||||
if (r != Result.Success) {
|
if (r != Result.Success) {
|
||||||
@@ -283,7 +284,7 @@ public final class RowReaderJsonExtensions {
|
|||||||
|
|
||||||
case Decimal: {
|
case Decimal: {
|
||||||
java.math.BigDecimal value;
|
java.math.BigDecimal value;
|
||||||
OutObject<BigDecimal> tempOut_value14 = new OutObject<BigDecimal>();
|
Out<BigDecimal> tempOut_value14 = new Out<BigDecimal>();
|
||||||
r = reader.get().ReadDecimal(tempOut_value14);
|
r = reader.get().ReadDecimal(tempOut_value14);
|
||||||
value = tempOut_value14.get();
|
value = tempOut_value14.get();
|
||||||
if (r != Result.Success) {
|
if (r != Result.Success) {
|
||||||
@@ -296,7 +297,7 @@ public final class RowReaderJsonExtensions {
|
|||||||
|
|
||||||
case DateTime: {
|
case DateTime: {
|
||||||
java.time.LocalDateTime value;
|
java.time.LocalDateTime value;
|
||||||
OutObject<LocalDateTime> tempOut_value15 = new OutObject<LocalDateTime>();
|
Out<LocalDateTime> tempOut_value15 = new Out<LocalDateTime>();
|
||||||
r = reader.get().ReadDateTime(tempOut_value15);
|
r = reader.get().ReadDateTime(tempOut_value15);
|
||||||
value = tempOut_value15.get();
|
value = tempOut_value15.get();
|
||||||
if (r != Result.Success) {
|
if (r != Result.Success) {
|
||||||
@@ -311,8 +312,8 @@ public final class RowReaderJsonExtensions {
|
|||||||
|
|
||||||
case UnixDateTime: {
|
case UnixDateTime: {
|
||||||
UnixDateTime value;
|
UnixDateTime value;
|
||||||
OutObject<UnixDateTime> tempOut_value16 =
|
Out<UnixDateTime> tempOut_value16 =
|
||||||
new OutObject<UnixDateTime>();
|
new Out<UnixDateTime>();
|
||||||
r = reader.get().ReadUnixDateTime(tempOut_value16);
|
r = reader.get().ReadUnixDateTime(tempOut_value16);
|
||||||
value = tempOut_value16.get();
|
value = tempOut_value16.get();
|
||||||
if (r != Result.Success) {
|
if (r != Result.Success) {
|
||||||
@@ -325,7 +326,7 @@ public final class RowReaderJsonExtensions {
|
|||||||
|
|
||||||
case Guid: {
|
case Guid: {
|
||||||
java.util.UUID value;
|
java.util.UUID value;
|
||||||
OutObject<UUID> tempOut_value17 = new OutObject<UUID>();
|
Out<UUID> tempOut_value17 = new Out<UUID>();
|
||||||
r = reader.get().ReadGuid(tempOut_value17);
|
r = reader.get().ReadGuid(tempOut_value17);
|
||||||
value = tempOut_value17.get();
|
value = tempOut_value17.get();
|
||||||
if (r != Result.Success) {
|
if (r != Result.Success) {
|
||||||
@@ -340,7 +341,7 @@ public final class RowReaderJsonExtensions {
|
|||||||
|
|
||||||
case MongoDbObjectId: {
|
case MongoDbObjectId: {
|
||||||
MongoDbObjectId value;
|
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);
|
r = reader.get().ReadMongoDbObjectId(tempOut_value18);
|
||||||
value = tempOut_value18.get();
|
value = tempOut_value18.get();
|
||||||
if (r != Result.Success) {
|
if (r != Result.Success) {
|
||||||
@@ -359,7 +360,7 @@ public final class RowReaderJsonExtensions {
|
|||||||
case Utf8: {
|
case Utf8: {
|
||||||
Utf8Span value;
|
Utf8Span value;
|
||||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword
|
// 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:
|
// code being modified:
|
||||||
r = reader.get().ReadString(out value);
|
r = reader.get().ReadString(out value);
|
||||||
if (r != Result.Success) {
|
if (r != Result.Success) {
|
||||||
@@ -374,7 +375,7 @@ public final class RowReaderJsonExtensions {
|
|||||||
|
|
||||||
case Binary: {
|
case Binary: {
|
||||||
ReadOnlySpan<Byte> value;
|
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:
|
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||||
//ORIGINAL LINE: r = reader.ReadBinary(out ReadOnlySpan<byte> value);
|
//ORIGINAL LINE: r = reader.ReadBinary(out ReadOnlySpan<byte> value);
|
||||||
r = reader.get().ReadBinary(out value);
|
r = reader.get().ReadBinary(out value);
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ public final class RowReaderJsonSettings {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* The quote character to use.
|
* The quote character to use.
|
||||||
* May be <see cref="lang:\""/> or <see cref="'" />.
|
* May be <see cref="lang:\""/> or {@link '}.
|
||||||
*/
|
*/
|
||||||
public char QuoteChar;
|
public char QuoteChar;
|
||||||
|
|
||||||
|
|||||||
@@ -4,30 +4,33 @@
|
|||||||
|
|
||||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
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.Result;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An optional interface that indicates a <see cref="LayoutType{T}" /> can also write using a
|
* An optional interface that indicates a {@link LayoutType{T}} can also write using a {@link ReadOnlySequence{T}}.
|
||||||
* <see cref="ReadOnlySequence{T}" />.
|
|
||||||
*
|
*
|
||||||
* <typeparam name="TElement">The sub-element type to be written.</typeparam>
|
* <typeparam name="TElement">The sub-element type to be written.</typeparam>
|
||||||
*/
|
*/
|
||||||
public interface ILayoutSequenceWritable<TElement> extends ILayoutType {
|
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,
|
Result WriteFixed(
|
||||||
ReadOnlySequence<TElement> value);
|
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:
|
Result WriteSparse(
|
||||||
//ORIGINAL LINE: Result WriteSparse(ref RowBuffer b, ref RowCursor edit, ReadOnlySequence<TElement> value,
|
Reference<RowBuffer> b, Reference<RowCursor> edit, ReadOnlySequence<TElement> value);
|
||||||
// UpdateOptions options = UpdateOptions.Upsert);
|
|
||||||
Result WriteSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
|
||||||
ReadOnlySequence<TElement> value, UpdateOptions options);
|
|
||||||
|
|
||||||
Result WriteVariable(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
// C# TO JAVA CONVERTER NOTE:
|
||||||
ReadOnlySequence<TElement> value);
|
// 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;
|
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.RefObject;
|
import com.azure.data.cosmos.core.Reference;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.Result;
|
import com.azure.data.cosmos.serialization.hybridrow.Result;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An optional interface that indicates a <see cref="LayoutType{T}" /> can also read using a
|
* An optional interface that indicates a {@link LayoutType{T}} can also read using a {@link ReadOnlySpan{T}}
|
||||||
* <see cref="ReadOnlySpan{T}" />.
|
|
||||||
*
|
*
|
||||||
* <typeparam name="TElement">The sub-element type to be written.</typeparam>
|
* <typeparam name="TElement">The sub-element type to be written.</typeparam>
|
||||||
*/
|
*/
|
||||||
public interface ILayoutSpanReadable<TElement> extends ILayoutType {
|
public interface ILayoutSpanReadable<TElement> extends ILayoutType {
|
||||||
Result ReadFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
Result ReadFixed(
|
||||||
OutObject<ReadOnlySpan<TElement>> value);
|
Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col, Out<ReadOnlySpan<TElement>> value);
|
||||||
|
|
||||||
Result ReadSparse(RefObject<RowBuffer> b, RefObject<RowCursor> scope,
|
Result ReadSparse(
|
||||||
OutObject<ReadOnlySpan<TElement>> value);
|
Reference<RowBuffer> b, Reference<RowCursor> scope, Out<ReadOnlySpan<TElement>> value);
|
||||||
|
|
||||||
Result ReadVariable(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
Result ReadVariable(
|
||||||
OutObject<ReadOnlySpan<TElement>> value);
|
Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col, Out<ReadOnlySpan<TElement>> value);
|
||||||
}
|
}
|
||||||
@@ -4,30 +4,32 @@
|
|||||||
|
|
||||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
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.Result;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An optional interface that indicates a <see cref="LayoutType{T}" /> can also write using a
|
* An optional interface that indicates a {@link LayoutType{T}} can also write using a
|
||||||
* <see cref="ReadOnlySpan{T}" />.
|
* {@link ReadOnlySpan{T}}.
|
||||||
*
|
*
|
||||||
* <typeparam name="TElement">The sub-element type to be written.</typeparam>
|
* <typeparam name="TElement">The sub-element type to be written.</typeparam>
|
||||||
*/
|
*/
|
||||||
public interface ILayoutSpanWritable<TElement> extends ILayoutType {
|
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,
|
Result WriteFixed(
|
||||||
ReadOnlySpan<TElement> value);
|
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:
|
Result WriteSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, ReadOnlySpan<TElement> value);
|
||||||
//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 WriteVariable(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
// C# TO JAVA CONVERTER NOTE:
|
||||||
ReadOnlySpan<TElement> value);
|
// 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;
|
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.RefObject;
|
import com.azure.data.cosmos.core.Reference;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.Result;
|
import com.azure.data.cosmos.serialization.hybridrow.Result;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An optional interface that indicates a <see cref="LayoutType{T}" /> can also read using a
|
* An optional interface that indicates a {@link LayoutType{T}} can also read using a {@link Utf8Span}.
|
||||||
* <see cref="Utf8Span" />.
|
|
||||||
*/
|
*/
|
||||||
public interface ILayoutUtf8SpanReadable extends ILayoutType {
|
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,
|
Result ReadSparse(Reference<RowBuffer> b, Reference<RowCursor> scope, Out<Utf8Span> value);
|
||||||
OutObject<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;
|
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.Result;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An optional interface that indicates a <see cref="LayoutType{T}" /> can also write using a
|
* An optional interface that indicates a {@link LayoutType{T}} can also write using a {@link Utf8Span}.
|
||||||
* <see cref="Utf8Span" />.
|
|
||||||
*/
|
*/
|
||||||
public interface ILayoutUtf8SpanWritable extends ILayoutType {
|
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:
|
Result WriteSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, Utf8Span value);
|
||||||
//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 WriteVariable(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
// C# TO JAVA CONVERTER NOTE:
|
||||||
Utf8Span value);
|
// 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;
|
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.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 com.azure.data.cosmos.serialization.hybridrow.schemas.StorageKind;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A Layout describes the structure of a Hybrd Row.
|
* A Layout describes the structure of a Hybrid Row
|
||||||
* <p>
|
* <p>
|
||||||
* A layout indicates the number, order, and type of all schematized columns to be stored
|
* A layout indicates the number, order, and type of all schematized columns to be stored within a hybrid row. The
|
||||||
* within a hybrid row. The order and type of columns defines the physical ordering of bytes used to
|
* order and type of columns defines the physical ordering of bytes used to encode the row and impacts the cost of
|
||||||
* encode the row and impacts the cost of updating the row.
|
* updating the row.
|
||||||
* <para />
|
* <p>
|
||||||
* A layout is created by compiling a <see cref="Schema" /> through <see cref="Schema.Compile" /> or
|
* A layout is created by compiling a {@link Schema} through {@link Schema#Compile(Namespace)} or by constructor through
|
||||||
* by constructor through a <see cref="LayoutBuilder" />.
|
* a {@link LayoutBuilder}.
|
||||||
* <para />
|
*
|
||||||
* <see cref="Layout" /> is immutable.
|
* {@link Layout} is immutable.
|
||||||
*/
|
*/
|
||||||
public final class Layout {
|
public final class Layout {
|
||||||
// TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes:
|
|
||||||
//ORIGINAL LINE: [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes",
|
// TODO: C# TO JAVA CONVERTER:
|
||||||
// Justification = "Type is immutable.")] public static readonly Layout Empty = SystemSchema.LayoutResolver
|
// Java annotations will not correspond to .NET attributes:
|
||||||
// .Resolve(SystemSchema.EmptySchemaId);
|
// 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);
|
public static final Layout Empty = SystemSchema.LayoutResolver.Resolve(SystemSchema.EmptySchemaId);
|
||||||
/**
|
/**
|
||||||
* Name of the layout.
|
* Name of the layout.
|
||||||
* <p>
|
* <p>
|
||||||
* Usually this is the name of the <see cref="Schema" /> from which this
|
* Usually this is the name of the {@link Schema} from which this {@link Layout} was generated.
|
||||||
* <see cref="Layout" /> was generated.
|
|
||||||
*/
|
*/
|
||||||
private String Name;
|
private String Name;
|
||||||
/**
|
/**
|
||||||
* The number of bitmask bytes allocated within the layout.
|
* The number of bit mask bytes allocated within the layout.
|
||||||
* <p>
|
* <p>
|
||||||
* A presence bit is allocated for each fixed and variable-length field. Sparse columns
|
* 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
|
* 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;
|
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();
|
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 HashMap<String, LayoutColumn> pathStringMap;
|
||||||
private LayoutColumn[] topColumns;
|
private LayoutColumn[] topColumns;
|
||||||
|
|
||||||
public Layout(String name, SchemaId schemaId, int numBitmaskBytes, int minRequiredSize,
|
public Layout(String name, SchemaId schemaId, int numBitmaskBytes, int minRequiredSize, ArrayList<LayoutColumn> columns) {
|
||||||
ArrayList<LayoutColumn> columns) {
|
|
||||||
this.Name = name;
|
this.Name = name;
|
||||||
this.SchemaId = schemaId.clone();
|
this.SchemaId = schemaId.clone();
|
||||||
this.NumBitmaskBytes = numBitmaskBytes;
|
this.NumBitmaskBytes = numBitmaskBytes;
|
||||||
@@ -133,10 +136,11 @@ public final class Layout {
|
|||||||
* Finds a column specification for a column with a matching path.
|
* Finds a column specification for a column with a matching path.
|
||||||
*
|
*
|
||||||
* @param path The path of the column to find.
|
* @param path The path of the column to find.
|
||||||
* @param column If found, the column specification, otherwise null.
|
* @param column If found, the column specification, otherwise {@code null}.
|
||||||
* @return True if a column with the path is found, otherwise false.
|
* @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) {
|
if (path.IsNull) {
|
||||||
column.set(null);
|
column.set(null);
|
||||||
return false;
|
return false;
|
||||||
@@ -156,12 +160,12 @@ public final class Layout {
|
|||||||
* @param column If found, the column specification, otherwise null.
|
* @param column If found, the column specification, otherwise null.
|
||||||
* @return True if a column with the path is found, otherwise false.
|
* @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());
|
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.
|
* This representation should only be used for debugging and diagnostic purposes.
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -4,8 +4,8 @@
|
|||||||
|
|
||||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
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.RefObject;
|
import com.azure.data.cosmos.core.Reference;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.Result;
|
import com.azure.data.cosmos.serialization.hybridrow.Result;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
||||||
@@ -32,10 +32,10 @@ public final class LayoutArray extends LayoutIndexedScope {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result WriteScope(
|
public Result WriteScope(
|
||||||
RefObject<RowBuffer> b,
|
Reference<RowBuffer> b,
|
||||||
RefObject<RowCursor> edit,
|
Reference<RowCursor> edit,
|
||||||
TypeArgumentList typeArgs,
|
TypeArgumentList typeArgs,
|
||||||
OutObject<RowCursor> value
|
Out<RowCursor> value
|
||||||
) {
|
) {
|
||||||
return WriteScope(b, edit, typeArgs, value, UpdateOptions.Upsert);
|
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
|
//ORIGINAL LINE: public override Result WriteScope(ref RowBuffer b, ref RowCursor edit, TypeArgumentList
|
||||||
// typeArgs, out RowCursor value, UpdateOptions options = UpdateOptions.Upsert)
|
// typeArgs, out RowCursor value, UpdateOptions options = UpdateOptions.Upsert)
|
||||||
@Override
|
@Override
|
||||||
public Result WriteScope(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
public Result WriteScope(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||||
TypeArgumentList typeArgs, OutObject<RowCursor> value, UpdateOptions options) {
|
TypeArgumentList typeArgs, Out<RowCursor> value, UpdateOptions options) {
|
||||||
Result result = PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options);
|
Result result = PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options);
|
||||||
if (result != Result.Success) {
|
if (result != Result.Success) {
|
||||||
value.set(null);
|
value.set(null);
|
||||||
|
|||||||
@@ -4,8 +4,9 @@
|
|||||||
|
|
||||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
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.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.Result;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
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
|
//ORIGINAL LINE: public override Result ReadFixed(ref RowBuffer b, ref RowCursor scope, LayoutColumn col, out
|
||||||
// byte[] value)
|
// byte[] value)
|
||||||
@Override
|
@Override
|
||||||
public Result ReadFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
public Result ReadFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col,
|
||||||
OutObject<byte[]> value) {
|
Out<byte[]> value) {
|
||||||
ReadOnlySpan<Byte> span;
|
ReadOnlySpan<Byte> span;
|
||||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
|
// 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:
|
//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);
|
//ORIGINAL LINE: Result r = this.ReadFixed(ref b, ref scope, col, out ReadOnlySpan<byte> span);
|
||||||
Result r = this.ReadFixed(b, scope, col, out 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:
|
//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
|
//ORIGINAL LINE: public Result ReadFixed(ref RowBuffer b, ref RowCursor scope, LayoutColumn col, out
|
||||||
// ReadOnlySpan<byte> value)
|
// ReadOnlySpan<byte> value)
|
||||||
public Result ReadFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
public Result ReadFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col,
|
||||||
OutObject<ReadOnlySpan<Byte>> value) {
|
Out<ReadOnlySpan<Byte>> value) {
|
||||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||||
checkArgument(col.getSize() >= 0);
|
checkArgument(col.getSize() >= 0);
|
||||||
if (!b.get().ReadBit(scope.get().start, col.getNullBit().clone())) {
|
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:
|
//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)
|
//ORIGINAL LINE: public override Result ReadSparse(ref RowBuffer b, ref RowCursor edit, out byte[] value)
|
||||||
@Override
|
@Override
|
||||||
public Result ReadSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
public Result ReadSparse(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||||
OutObject<byte[]> value) {
|
Out<byte[]> value) {
|
||||||
ReadOnlySpan<Byte> span;
|
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:
|
//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);
|
//ORIGINAL LINE: Result r = this.ReadSparse(ref b, ref edit, out ReadOnlySpan<byte> span);
|
||||||
Result r = this.ReadSparse(b, edit, out 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:
|
//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)
|
//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);
|
Result result = LayoutType.PrepareSparseRead(b, edit, this.LayoutCode);
|
||||||
if (result != Result.Success) {
|
if (result != Result.Success) {
|
||||||
value.set(null);
|
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
|
//ORIGINAL LINE: public override Result ReadVariable(ref RowBuffer b, ref RowCursor scope, LayoutColumn col, out
|
||||||
// byte[] value)
|
// byte[] value)
|
||||||
@Override
|
@Override
|
||||||
public Result ReadVariable(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col
|
public Result ReadVariable(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col
|
||||||
, OutObject<byte[]> value) {
|
, Out<byte[]> value) {
|
||||||
ReadOnlySpan<Byte> span;
|
ReadOnlySpan<Byte> span;
|
||||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
|
// 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:
|
//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);
|
//ORIGINAL LINE: Result r = this.ReadVariable(ref b, ref scope, col, out ReadOnlySpan<byte> span);
|
||||||
Result r = this.ReadVariable(b, scope, col, out 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:
|
//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
|
//ORIGINAL LINE: public Result ReadVariable(ref RowBuffer b, ref RowCursor scope, LayoutColumn col, out
|
||||||
// ReadOnlySpan<byte> value)
|
// ReadOnlySpan<byte> value)
|
||||||
public Result ReadVariable(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col
|
public Result ReadVariable(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col
|
||||||
, OutObject<ReadOnlySpan<Byte>> value) {
|
, Out<ReadOnlySpan<Byte>> value) {
|
||||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||||
if (!b.get().ReadBit(scope.get().start, col.getNullBit().clone())) {
|
if (!b.get().ReadBit(scope.get().start, col.getNullBit().clone())) {
|
||||||
value.set(null);
|
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[]
|
//ORIGINAL LINE: public override Result WriteFixed(ref RowBuffer b, ref RowCursor scope, LayoutColumn col, byte[]
|
||||||
// value)
|
// value)
|
||||||
@Override
|
@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) {
|
byte[] value) {
|
||||||
checkArgument(value != null);
|
checkArgument(value != null);
|
||||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
//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:
|
//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,
|
//ORIGINAL LINE: public Result WriteFixed(ref RowBuffer b, ref RowCursor scope, LayoutColumn col,
|
||||||
// ReadOnlySpan<byte> value)
|
// 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) {
|
ReadOnlySpan<Byte> value) {
|
||||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||||
checkArgument(col.getSize() >= 0);
|
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:
|
//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,
|
//ORIGINAL LINE: public Result WriteFixed(ref RowBuffer b, ref RowCursor scope, LayoutColumn col,
|
||||||
// ReadOnlySequence<byte> value)
|
// 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) {
|
ReadOnlySequence<Byte> value) {
|
||||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||||
checkArgument(col.getSize() >= 0);
|
checkArgument(col.getSize() >= 0);
|
||||||
@@ -173,7 +174,7 @@ public final class LayoutBinary extends LayoutType<byte[]> implements ILayoutSpa
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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);
|
return WriteSparse(b, edit, value, UpdateOptions.Upsert);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -182,7 +183,7 @@ public final class LayoutBinary extends LayoutType<byte[]> implements ILayoutSpa
|
|||||||
// UpdateOptions options = UpdateOptions.Upsert)
|
// UpdateOptions options = UpdateOptions.Upsert)
|
||||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||||
@Override
|
@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) {
|
UpdateOptions options) {
|
||||||
checkArgument(value != null);
|
checkArgument(value != null);
|
||||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
//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);
|
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) {
|
ReadOnlySpan<Byte> value) {
|
||||||
return WriteSparse(b, edit, value, UpdateOptions.Upsert);
|
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,
|
//ORIGINAL LINE: public Result WriteSparse(ref RowBuffer b, ref RowCursor edit, ReadOnlySpan<byte> value,
|
||||||
// UpdateOptions options = UpdateOptions.Upsert)
|
// UpdateOptions options = UpdateOptions.Upsert)
|
||||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
//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) {
|
ReadOnlySpan<Byte> value, UpdateOptions options) {
|
||||||
Result result = LayoutType.PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options);
|
Result result = LayoutType.PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options);
|
||||||
if (result != Result.Success) {
|
if (result != Result.Success) {
|
||||||
@@ -210,7 +211,7 @@ public final class LayoutBinary extends LayoutType<byte[]> implements ILayoutSpa
|
|||||||
return Result.Success;
|
return Result.Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Result WriteSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
public Result WriteSparse(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||||
ReadOnlySequence<Byte> value) {
|
ReadOnlySequence<Byte> value) {
|
||||||
return WriteSparse(b, edit, value, UpdateOptions.Upsert);
|
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,
|
//ORIGINAL LINE: public Result WriteSparse(ref RowBuffer b, ref RowCursor edit, ReadOnlySequence<byte> value,
|
||||||
// UpdateOptions options = UpdateOptions.Upsert)
|
// UpdateOptions options = UpdateOptions.Upsert)
|
||||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
//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) {
|
ReadOnlySequence<Byte> value, UpdateOptions options) {
|
||||||
Result result = LayoutType.PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options);
|
Result result = LayoutType.PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options);
|
||||||
if (result != Result.Success) {
|
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,
|
//ORIGINAL LINE: public override Result WriteVariable(ref RowBuffer b, ref RowCursor scope, LayoutColumn col,
|
||||||
// byte[] value)
|
// byte[] value)
|
||||||
@Override
|
@Override
|
||||||
public Result WriteVariable(RefObject<RowBuffer> b, RefObject<RowCursor> scope,
|
public Result WriteVariable(Reference<RowBuffer> b, Reference<RowCursor> scope,
|
||||||
LayoutColumn col, byte[] value) {
|
LayoutColumn col, byte[] value) {
|
||||||
checkArgument(value != null);
|
checkArgument(value != null);
|
||||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
//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:
|
//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,
|
//ORIGINAL LINE: public Result WriteVariable(ref RowBuffer b, ref RowCursor scope, LayoutColumn col,
|
||||||
// ReadOnlySpan<byte> value)
|
// 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) {
|
LayoutColumn col, ReadOnlySpan<Byte> value) {
|
||||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||||
if (scope.get().immutable) {
|
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,
|
int varOffset = b.get().ComputeVariableValueOffset(scope.get().layout, scope.get().start,
|
||||||
col.getOffset());
|
col.getOffset());
|
||||||
int shift;
|
int shift;
|
||||||
OutObject<Integer> tempOut_shift = new OutObject<Integer>();
|
Out<Integer> tempOut_shift = new Out<Integer>();
|
||||||
b.get().WriteVariableBinary(varOffset, value, exists, tempOut_shift);
|
b.get().WriteVariableBinary(varOffset, value, exists, tempOut_shift);
|
||||||
shift = tempOut_shift.get();
|
shift = tempOut_shift.get();
|
||||||
b.get().SetBit(scope.get().start, col.getNullBit().clone());
|
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:
|
//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,
|
//ORIGINAL LINE: public Result WriteVariable(ref RowBuffer b, ref RowCursor scope, LayoutColumn col,
|
||||||
// ReadOnlySequence<byte> value)
|
// 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) {
|
LayoutColumn col, ReadOnlySequence<Byte> value) {
|
||||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||||
if (scope.get().immutable) {
|
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,
|
int varOffset = b.get().ComputeVariableValueOffset(scope.get().layout, scope.get().start,
|
||||||
col.getOffset());
|
col.getOffset());
|
||||||
int shift;
|
int shift;
|
||||||
OutObject<Integer> tempOut_shift = new OutObject<Integer>();
|
Out<Integer> tempOut_shift = new Out<Integer>();
|
||||||
b.get().WriteVariableBinary(varOffset, value, exists, tempOut_shift);
|
b.get().WriteVariableBinary(varOffset, value, exists, tempOut_shift);
|
||||||
shift = tempOut_shift.get();
|
shift = tempOut_shift.get();
|
||||||
b.get().SetBit(scope.get().start, col.getNullBit().clone());
|
b.get().SetBit(scope.get().start, col.getNullBit().clone());
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ public final class LayoutBit implements IEquatable<LayoutBit> {
|
|||||||
private int index;
|
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.
|
* @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.
|
* 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.
|
* @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
|
* Returns the 0-based byte offset from the beginning of the row or scope that contains the
|
||||||
* bit from the bitmask.
|
* bit from the bitmask.
|
||||||
* <p>
|
* <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.
|
* @param offset The byte offset from the beginning of the row where the scope begins.
|
||||||
* @return The byte offset containing this bit.
|
* @return The byte offset containing this bit.
|
||||||
@@ -130,7 +130,7 @@ public final class LayoutBit implements IEquatable<LayoutBit> {
|
|||||||
private int next;
|
private int next;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initializes a new instance of the <see cref="Allocator" /> class.
|
* Initializes a new instance of the {@link Allocator} class.
|
||||||
*/
|
*/
|
||||||
public Allocator() {
|
public Allocator() {
|
||||||
this.next = 0;
|
this.next = 0;
|
||||||
|
|||||||
@@ -4,8 +4,9 @@
|
|||||||
|
|
||||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
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.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.Result;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
||||||
@@ -33,8 +34,8 @@ public final class LayoutBoolean extends LayoutType<Boolean> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result ReadFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
public Result ReadFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col,
|
||||||
OutObject<Boolean> value) {
|
Out<Boolean> value) {
|
||||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||||
if (!b.get().ReadBit(scope.get().start, col.getNullBit().clone())) {
|
if (!b.get().ReadBit(scope.get().start, col.getNullBit().clone())) {
|
||||||
value.set(false);
|
value.set(false);
|
||||||
@@ -46,8 +47,8 @@ public final class LayoutBoolean extends LayoutType<Boolean> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result ReadSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
public Result ReadSparse(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||||
OutObject<Boolean> value) {
|
Out<Boolean> value) {
|
||||||
Result result = LayoutType.PrepareSparseRead(b, edit, this.LayoutCode);
|
Result result = LayoutType.PrepareSparseRead(b, edit, this.LayoutCode);
|
||||||
if (result != Result.Success) {
|
if (result != Result.Success) {
|
||||||
value.set(false);
|
value.set(false);
|
||||||
@@ -59,7 +60,7 @@ public final class LayoutBoolean extends LayoutType<Boolean> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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) {
|
boolean value) {
|
||||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||||
if (scope.get().immutable) {
|
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,
|
//ORIGINAL LINE: public override Result WriteSparse(ref RowBuffer b, ref RowCursor edit, bool value,
|
||||||
// UpdateOptions options = UpdateOptions.Upsert)
|
// UpdateOptions options = UpdateOptions.Upsert)
|
||||||
@Override
|
@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) {
|
UpdateOptions options) {
|
||||||
Result result = LayoutType.PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options);
|
Result result = LayoutType.PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options);
|
||||||
if (result != Result.Success) {
|
if (result != Result.Success) {
|
||||||
@@ -92,7 +93,7 @@ public final class LayoutBoolean extends LayoutType<Boolean> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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);
|
return WriteSparse(b, edit, value, UpdateOptions.Upsert);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -18,7 +18,7 @@ public final class LayoutCodeTraits {
|
|||||||
/**
|
/**
|
||||||
* Returns a canonicalized version of the layout code.
|
* Returns a canonicalized version of the layout code.
|
||||||
* <p>
|
* <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
|
* values. This function converts actual value based code into the canonicalized type code for schema
|
||||||
* comparisons.
|
* comparisons.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
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 com.azure.data.cosmos.serialization.hybridrow.schemas.StorageKind;
|
||||||
|
|
||||||
import static com.google.common.base.Strings.lenientFormat;
|
import static com.google.common.base.Strings.lenientFormat;
|
||||||
@@ -30,13 +31,13 @@ public final class LayoutColumn {
|
|||||||
*/
|
*/
|
||||||
private LayoutBit nullBit = new LayoutBit();
|
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.
|
* the field location.
|
||||||
* <para />
|
* <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.
|
* field from the beginning of the variable length segment.
|
||||||
* <para />
|
* <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;
|
private int offset;
|
||||||
/**
|
/**
|
||||||
@@ -48,7 +49,7 @@ public final class LayoutColumn {
|
|||||||
*/
|
*/
|
||||||
private Utf8String path;
|
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.
|
* holding the value of this type, otherwise must be 0.
|
||||||
*/
|
*/
|
||||||
private int size;
|
private int size;
|
||||||
@@ -65,12 +66,12 @@ public final class LayoutColumn {
|
|||||||
*/
|
*/
|
||||||
private TypeArgument typeArg = new TypeArgument();
|
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();
|
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 path The path to the field relative to parent scope.
|
||||||
* @param type Type of the field.
|
* @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 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 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 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.
|
* parameters.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -112,8 +113,8 @@ public final class LayoutColumn {
|
|||||||
/**
|
/**
|
||||||
* The full logical path of the field within the row.
|
* The full logical path of the field within the row.
|
||||||
* <p>
|
* <p>
|
||||||
* Paths are expressed in dotted notation: e.g. a relative <see cref="Path" /> of 'b.c'
|
* Paths are expressed in dotted notation: e.g. a relative {@link Path} of 'b.c'
|
||||||
* within the scope 'a' yields a <see cref="FullPath" /> of 'a.b.c'.
|
* within the scope 'a' yields a {@link FullPath} of 'a.b.c'.
|
||||||
*/
|
*/
|
||||||
public Utf8String getFullPath() {
|
public Utf8String getFullPath() {
|
||||||
return this.fullPath;
|
return this.fullPath;
|
||||||
@@ -137,8 +138,8 @@ public final class LayoutColumn {
|
|||||||
/**
|
/**
|
||||||
* The relative path of the field within its parent scope.
|
* The relative path of the field within its parent scope.
|
||||||
* <p>
|
* <p>
|
||||||
* Paths are expressed in dotted notation: e.g. a relative <see cref="Path" /> of 'b.c'
|
* Paths are expressed in dotted notation: e.g. a relative {@link Path} of 'b.c'
|
||||||
* within the scope 'a' yields a <see cref="FullPath" /> of 'a.b.c'.
|
* within the scope 'a' yields a {@link FullPath} of 'a.b.c'.
|
||||||
*/
|
*/
|
||||||
public Utf8String getPath() {
|
public Utf8String getPath() {
|
||||||
return this.path;
|
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() {
|
public TypeArgumentList getTypeArgs() {
|
||||||
return this.typeArgs.clone();
|
return this.typeArgs.clone();
|
||||||
@@ -200,21 +201,21 @@ public final class LayoutColumn {
|
|||||||
LayoutBit getNullBit()
|
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.
|
* the field location.
|
||||||
* <para />
|
* <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.
|
* field from the beginning of the variable length segment.
|
||||||
* <para />
|
* <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()
|
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.
|
* bytes reserved for the value.
|
||||||
* <para />
|
* <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.
|
* bytes allowed for the value.
|
||||||
*/
|
*/
|
||||||
int getSize()
|
int getSize()
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
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.SchemaId;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.schemas.ArrayPropertyType;
|
import com.azure.data.cosmos.serialization.hybridrow.schemas.ArrayPropertyType;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.schemas.MapPropertyType;
|
import com.azure.data.cosmos.serialization.hybridrow.schemas.MapPropertyType;
|
||||||
@@ -53,8 +53,8 @@ public final class LayoutCompiler {
|
|||||||
ArrayList<Property> properties) {
|
ArrayList<Property> properties) {
|
||||||
for (Property p : properties) {
|
for (Property p : properties) {
|
||||||
TypeArgumentList typeArgs = new TypeArgumentList();
|
TypeArgumentList typeArgs = new TypeArgumentList();
|
||||||
OutObject<TypeArgumentList> tempOut_typeArgs =
|
Out<TypeArgumentList> tempOut_typeArgs =
|
||||||
new OutObject<TypeArgumentList>();
|
new Out<TypeArgumentList>();
|
||||||
LayoutType type = LayoutCompiler.LogicalToPhysicalType(ns, p.getPropertyType(), tempOut_typeArgs);
|
LayoutType type = LayoutCompiler.LogicalToPhysicalType(ns, p.getPropertyType(), tempOut_typeArgs);
|
||||||
typeArgs = tempOut_typeArgs.get();
|
typeArgs = tempOut_typeArgs.get();
|
||||||
switch (LayoutCodeTraits.ClearImmutableBit(type.LayoutCode)) {
|
switch (LayoutCodeTraits.ClearImmutableBit(type.LayoutCode)) {
|
||||||
@@ -149,7 +149,7 @@ public final class LayoutCompiler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static LayoutType LogicalToPhysicalType(Namespace ns, PropertyType logicalType,
|
private static LayoutType LogicalToPhysicalType(Namespace ns, PropertyType logicalType,
|
||||||
OutObject<TypeArgumentList> typeArgs) {
|
Out<TypeArgumentList> typeArgs) {
|
||||||
typeArgs.set(TypeArgumentList.Empty);
|
typeArgs.set(TypeArgumentList.Empty);
|
||||||
boolean tempVar =
|
boolean tempVar =
|
||||||
(logicalType instanceof ScopePropertyType ? (ScopePropertyType)logicalType : null).getImmutable();
|
(logicalType instanceof ScopePropertyType ? (ScopePropertyType)logicalType : null).getImmutable();
|
||||||
@@ -209,7 +209,7 @@ public final class LayoutCompiler {
|
|||||||
ArrayPropertyType ap = (ArrayPropertyType)logicalType;
|
ArrayPropertyType ap = (ArrayPropertyType)logicalType;
|
||||||
if ((ap.getItems() != null) && (ap.getItems().getType() != TypeKind.Any)) {
|
if ((ap.getItems() != null) && (ap.getItems().getType() != TypeKind.Any)) {
|
||||||
TypeArgumentList itemTypeArgs = new TypeArgumentList();
|
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);
|
LayoutType itemType = LayoutCompiler.LogicalToPhysicalType(ns, ap.getItems(), tempOut_itemTypeArgs);
|
||||||
itemTypeArgs = tempOut_itemTypeArgs.get();
|
itemTypeArgs = tempOut_itemTypeArgs.get();
|
||||||
if (ap.getItems().getNullable()) {
|
if (ap.getItems().getNullable()) {
|
||||||
@@ -228,7 +228,7 @@ public final class LayoutCompiler {
|
|||||||
SetPropertyType sp = (SetPropertyType)logicalType;
|
SetPropertyType sp = (SetPropertyType)logicalType;
|
||||||
if ((sp.getItems() != null) && (sp.getItems().getType() != TypeKind.Any)) {
|
if ((sp.getItems() != null) && (sp.getItems().getType() != TypeKind.Any)) {
|
||||||
TypeArgumentList itemTypeArgs = new TypeArgumentList();
|
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(),
|
LayoutType itemType = LayoutCompiler.LogicalToPhysicalType(ns, sp.getItems(),
|
||||||
tempOut_itemTypeArgs2);
|
tempOut_itemTypeArgs2);
|
||||||
itemTypeArgs = tempOut_itemTypeArgs2.get();
|
itemTypeArgs = tempOut_itemTypeArgs2.get();
|
||||||
@@ -251,7 +251,7 @@ public final class LayoutCompiler {
|
|||||||
MapPropertyType mp = (MapPropertyType)logicalType;
|
MapPropertyType mp = (MapPropertyType)logicalType;
|
||||||
if ((mp.getKeys() != null) && (mp.getKeys().getType() != TypeKind.Any) && (mp.getValues() != null) && (mp.getValues().getType() != TypeKind.Any)) {
|
if ((mp.getKeys() != null) && (mp.getKeys().getType() != TypeKind.Any) && (mp.getValues() != null) && (mp.getValues().getType() != TypeKind.Any)) {
|
||||||
TypeArgumentList keyTypeArgs = new TypeArgumentList();
|
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);
|
LayoutType keyType = LayoutCompiler.LogicalToPhysicalType(ns, mp.getKeys(), tempOut_keyTypeArgs);
|
||||||
keyTypeArgs = tempOut_keyTypeArgs.get();
|
keyTypeArgs = tempOut_keyTypeArgs.get();
|
||||||
if (mp.getKeys().getNullable()) {
|
if (mp.getKeys().getNullable()) {
|
||||||
@@ -261,7 +261,7 @@ public final class LayoutCompiler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
TypeArgumentList valueTypeArgs = new TypeArgumentList();
|
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(),
|
LayoutType valueType = LayoutCompiler.LogicalToPhysicalType(ns, mp.getValues(),
|
||||||
tempOut_valueTypeArgs);
|
tempOut_valueTypeArgs);
|
||||||
valueTypeArgs = tempOut_valueTypeArgs.get();
|
valueTypeArgs = tempOut_valueTypeArgs.get();
|
||||||
@@ -288,7 +288,7 @@ public final class LayoutCompiler {
|
|||||||
TypeArgument[] args = new TypeArgument[tp.getItems().size()];
|
TypeArgument[] args = new TypeArgument[tp.getItems().size()];
|
||||||
for (int i = 0; i < tp.getItems().size(); i++) {
|
for (int i = 0; i < tp.getItems().size(); i++) {
|
||||||
TypeArgumentList itemTypeArgs = new TypeArgumentList();
|
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),
|
LayoutType itemType = LayoutCompiler.LogicalToPhysicalType(ns, tp.getItems().get(i),
|
||||||
tempOut_itemTypeArgs3);
|
tempOut_itemTypeArgs3);
|
||||||
itemTypeArgs = tempOut_itemTypeArgs3.get();
|
itemTypeArgs = tempOut_itemTypeArgs3.get();
|
||||||
@@ -316,7 +316,7 @@ public final class LayoutCompiler {
|
|||||||
tgArgs[0] = new TypeArgument(LayoutType.UInt8, TypeArgumentList.Empty);
|
tgArgs[0] = new TypeArgument(LayoutType.UInt8, TypeArgumentList.Empty);
|
||||||
for (int i = 0; i < tg.getItems().size(); i++) {
|
for (int i = 0; i < tg.getItems().size(); i++) {
|
||||||
TypeArgumentList itemTypeArgs = new TypeArgumentList();
|
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),
|
LayoutType itemType = LayoutCompiler.LogicalToPhysicalType(ns, tg.getItems().get(i),
|
||||||
tempOut_itemTypeArgs4);
|
tempOut_itemTypeArgs4);
|
||||||
itemTypeArgs = tempOut_itemTypeArgs4.get();
|
itemTypeArgs = tempOut_itemTypeArgs4.get();
|
||||||
|
|||||||
@@ -4,8 +4,9 @@
|
|||||||
|
|
||||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
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.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.Result;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
||||||
@@ -30,8 +31,8 @@ public final class LayoutDateTime extends LayoutType<DateTime> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result ReadFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
public Result ReadFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col,
|
||||||
OutObject<LocalDateTime> value) {
|
Out<LocalDateTime> value) {
|
||||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||||
if (!b.get().ReadBit(scope.get().start, col.getNullBit().clone())) {
|
if (!b.get().ReadBit(scope.get().start, col.getNullBit().clone())) {
|
||||||
value.set(LocalDateTime.MIN);
|
value.set(LocalDateTime.MIN);
|
||||||
@@ -43,8 +44,8 @@ public final class LayoutDateTime extends LayoutType<DateTime> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result ReadSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
public Result ReadSparse(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||||
OutObject<LocalDateTime> value) {
|
Out<LocalDateTime> value) {
|
||||||
Result result = LayoutType.PrepareSparseRead(b, edit, this.LayoutCode);
|
Result result = LayoutType.PrepareSparseRead(b, edit, this.LayoutCode);
|
||||||
if (result != Result.Success) {
|
if (result != Result.Success) {
|
||||||
value.set(LocalDateTime.MIN);
|
value.set(LocalDateTime.MIN);
|
||||||
@@ -56,7 +57,7 @@ public final class LayoutDateTime extends LayoutType<DateTime> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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) {
|
LocalDateTime value) {
|
||||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||||
if (scope.get().immutable) {
|
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,
|
//ORIGINAL LINE: public override Result WriteSparse(ref RowBuffer b, ref RowCursor edit, DateTime value,
|
||||||
// UpdateOptions options = UpdateOptions.Upsert)
|
// UpdateOptions options = UpdateOptions.Upsert)
|
||||||
@Override
|
@Override
|
||||||
public Result WriteSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
public Result WriteSparse(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||||
LocalDateTime value, UpdateOptions options) {
|
LocalDateTime value, UpdateOptions options) {
|
||||||
Result result = LayoutType.PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options);
|
Result result = LayoutType.PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options);
|
||||||
if (result != Result.Success) {
|
if (result != Result.Success) {
|
||||||
@@ -84,7 +85,7 @@ public final class LayoutDateTime extends LayoutType<DateTime> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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);
|
return WriteSparse(b, edit, value, UpdateOptions.Upsert);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4,8 +4,9 @@
|
|||||||
|
|
||||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
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.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.Result;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
||||||
@@ -31,8 +32,8 @@ public final class LayoutDecimal extends LayoutType<BigDecimal> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result ReadFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
public Result ReadFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col,
|
||||||
OutObject<BigDecimal> value) {
|
Out<BigDecimal> value) {
|
||||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||||
if (!b.get().ReadBit(scope.get().start, col.getNullBit().clone())) {
|
if (!b.get().ReadBit(scope.get().start, col.getNullBit().clone())) {
|
||||||
value.set(new BigDecimal(0));
|
value.set(new BigDecimal(0));
|
||||||
@@ -44,8 +45,8 @@ public final class LayoutDecimal extends LayoutType<BigDecimal> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result ReadSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
public Result ReadSparse(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||||
OutObject<BigDecimal> value) {
|
Out<BigDecimal> value) {
|
||||||
Result result = LayoutType.PrepareSparseRead(b, edit, this.LayoutCode);
|
Result result = LayoutType.PrepareSparseRead(b, edit, this.LayoutCode);
|
||||||
if (result != Result.Success) {
|
if (result != Result.Success) {
|
||||||
value.set(new BigDecimal(0));
|
value.set(new BigDecimal(0));
|
||||||
@@ -57,7 +58,7 @@ public final class LayoutDecimal extends LayoutType<BigDecimal> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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) {
|
BigDecimal value) {
|
||||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||||
if (scope.get().immutable) {
|
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,
|
//ORIGINAL LINE: public override Result WriteSparse(ref RowBuffer b, ref RowCursor edit, decimal value,
|
||||||
// UpdateOptions options = UpdateOptions.Upsert)
|
// UpdateOptions options = UpdateOptions.Upsert)
|
||||||
@Override
|
@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) {
|
UpdateOptions options) {
|
||||||
Result result = LayoutType.PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options);
|
Result result = LayoutType.PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options);
|
||||||
if (result != Result.Success) {
|
if (result != Result.Success) {
|
||||||
@@ -85,7 +86,7 @@ public final class LayoutDecimal extends LayoutType<BigDecimal> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result WriteSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
public Result WriteSparse(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||||
java.math.BigDecimal value) {
|
java.math.BigDecimal value) {
|
||||||
return WriteSparse(b, edit, value, UpdateOptions.Upsert);
|
return WriteSparse(b, edit, value, UpdateOptions.Upsert);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,8 +4,9 @@
|
|||||||
|
|
||||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
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.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.Result;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
||||||
@@ -27,8 +28,8 @@ public final class LayoutEndScope extends LayoutScope {
|
|||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result WriteScope(RefObject<RowBuffer> b, RefObject<RowCursor> scope,
|
public Result WriteScope(Reference<RowBuffer> b, Reference<RowCursor> scope,
|
||||||
TypeArgumentList typeArgs, OutObject<RowCursor> value) {
|
TypeArgumentList typeArgs, Out<RowCursor> value) {
|
||||||
return WriteScope(b, scope, typeArgs, value, UpdateOptions.Upsert);
|
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
|
//ORIGINAL LINE: public override Result WriteScope(ref RowBuffer b, ref RowCursor scope, TypeArgumentList
|
||||||
// typeArgs, out RowCursor value, UpdateOptions options = UpdateOptions.Upsert)
|
// typeArgs, out RowCursor value, UpdateOptions options = UpdateOptions.Upsert)
|
||||||
@Override
|
@Override
|
||||||
public Result WriteScope(RefObject<RowBuffer> b, RefObject<RowCursor> scope,
|
public Result WriteScope(Reference<RowBuffer> b, Reference<RowCursor> scope,
|
||||||
TypeArgumentList typeArgs, OutObject<RowCursor> value, UpdateOptions options) {
|
TypeArgumentList typeArgs, Out<RowCursor> value, UpdateOptions options) {
|
||||||
Contract.Fail("Cannot write an EndScope directly");
|
Contract.Fail("Cannot write an EndScope directly");
|
||||||
value.set(null);
|
value.set(null);
|
||||||
return Result.Failure;
|
return Result.Failure;
|
||||||
|
|||||||
@@ -4,8 +4,9 @@
|
|||||||
|
|
||||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
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.RefObject;
|
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.Float128;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.Result;
|
import com.azure.data.cosmos.serialization.hybridrow.Result;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||||
@@ -29,8 +30,8 @@ public final class LayoutFloat128 extends LayoutType<com.azure.data.cosmos.seria
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result ReadFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
public Result ReadFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col,
|
||||||
OutObject<Float128> value) {
|
Out<Float128> value) {
|
||||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||||
if (!b.get().ReadBit(scope.get().start, col.getNullBit().clone())) {
|
if (!b.get().ReadBit(scope.get().start, col.getNullBit().clone())) {
|
||||||
value.set(null);
|
value.set(null);
|
||||||
@@ -42,8 +43,8 @@ public final class LayoutFloat128 extends LayoutType<com.azure.data.cosmos.seria
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result ReadSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
public Result ReadSparse(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||||
OutObject<Float128> value) {
|
Out<Float128> value) {
|
||||||
Result result = LayoutType.PrepareSparseRead(b, edit, this.LayoutCode);
|
Result result = LayoutType.PrepareSparseRead(b, edit, this.LayoutCode);
|
||||||
if (result != Result.Success) {
|
if (result != Result.Success) {
|
||||||
value.set(null);
|
value.set(null);
|
||||||
@@ -55,7 +56,7 @@ public final class LayoutFloat128 extends LayoutType<com.azure.data.cosmos.seria
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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) {
|
Float128 value) {
|
||||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||||
if (scope.get().immutable) {
|
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,
|
//ORIGINAL LINE: public override Result WriteSparse(ref RowBuffer b, ref RowCursor edit, Float128 value,
|
||||||
// UpdateOptions options = UpdateOptions.Upsert)
|
// UpdateOptions options = UpdateOptions.Upsert)
|
||||||
@Override
|
@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) {
|
UpdateOptions options) {
|
||||||
Result result = LayoutType.PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options);
|
Result result = LayoutType.PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options);
|
||||||
if (result != Result.Success) {
|
if (result != Result.Success) {
|
||||||
@@ -83,7 +84,7 @@ public final class LayoutFloat128 extends LayoutType<com.azure.data.cosmos.seria
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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);
|
return WriteSparse(b, edit, value, UpdateOptions.Upsert);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4,8 +4,9 @@
|
|||||||
|
|
||||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
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.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.Result;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
||||||
@@ -28,8 +29,8 @@ public final class LayoutFloat32 extends LayoutType<Float> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result ReadFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
public Result ReadFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col,
|
||||||
OutObject<Float> value) {
|
Out<Float> value) {
|
||||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||||
if (!b.get().ReadBit(scope.get().start, col.getNullBit().clone())) {
|
if (!b.get().ReadBit(scope.get().start, col.getNullBit().clone())) {
|
||||||
value.set(0);
|
value.set(0);
|
||||||
@@ -41,8 +42,8 @@ public final class LayoutFloat32 extends LayoutType<Float> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result ReadSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
public Result ReadSparse(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||||
OutObject<Float> value) {
|
Out<Float> value) {
|
||||||
Result result = PrepareSparseRead(b, edit, this.LayoutCode);
|
Result result = PrepareSparseRead(b, edit, this.LayoutCode);
|
||||||
if (result != Result.Success) {
|
if (result != Result.Success) {
|
||||||
value.set(0);
|
value.set(0);
|
||||||
@@ -54,7 +55,7 @@ public final class LayoutFloat32 extends LayoutType<Float> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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) {
|
float value) {
|
||||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||||
if (scope.get().immutable) {
|
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,
|
//ORIGINAL LINE: public override Result WriteSparse(ref RowBuffer b, ref RowCursor edit, float value,
|
||||||
// UpdateOptions options = UpdateOptions.Upsert)
|
// UpdateOptions options = UpdateOptions.Upsert)
|
||||||
@Override
|
@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) {
|
UpdateOptions options) {
|
||||||
Result result = PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options);
|
Result result = PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options);
|
||||||
if (result != Result.Success) {
|
if (result != Result.Success) {
|
||||||
@@ -82,7 +83,7 @@ public final class LayoutFloat32 extends LayoutType<Float> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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);
|
return WriteSparse(b, edit, value, UpdateOptions.Upsert);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4,8 +4,9 @@
|
|||||||
|
|
||||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
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.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.Result;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
||||||
@@ -28,8 +29,8 @@ public final class LayoutFloat64 extends LayoutType<Double> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result ReadFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
public Result ReadFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col,
|
||||||
OutObject<Double> value) {
|
Out<Double> value) {
|
||||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||||
if (!b.get().ReadBit(scope.get().start, col.getNullBit().clone())) {
|
if (!b.get().ReadBit(scope.get().start, col.getNullBit().clone())) {
|
||||||
value.set(0);
|
value.set(0);
|
||||||
@@ -41,8 +42,8 @@ public final class LayoutFloat64 extends LayoutType<Double> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result ReadSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
public Result ReadSparse(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||||
OutObject<Double> value) {
|
Out<Double> value) {
|
||||||
Result result = LayoutType.PrepareSparseRead(b, edit, this.LayoutCode);
|
Result result = LayoutType.PrepareSparseRead(b, edit, this.LayoutCode);
|
||||||
if (result != Result.Success) {
|
if (result != Result.Success) {
|
||||||
value.set(0);
|
value.set(0);
|
||||||
@@ -54,7 +55,7 @@ public final class LayoutFloat64 extends LayoutType<Double> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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) {
|
double value) {
|
||||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||||
if (scope.get().immutable) {
|
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,
|
//ORIGINAL LINE: public override Result WriteSparse(ref RowBuffer b, ref RowCursor edit, double value,
|
||||||
// UpdateOptions options = UpdateOptions.Upsert)
|
// UpdateOptions options = UpdateOptions.Upsert)
|
||||||
@Override
|
@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) {
|
UpdateOptions options) {
|
||||||
Result result = LayoutType.PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options);
|
Result result = LayoutType.PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options);
|
||||||
if (result != Result.Success) {
|
if (result != Result.Success) {
|
||||||
@@ -82,7 +83,7 @@ public final class LayoutFloat64 extends LayoutType<Double> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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);
|
return WriteSparse(b, edit, value, UpdateOptions.Upsert);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4,8 +4,9 @@
|
|||||||
|
|
||||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
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.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.Result;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
||||||
@@ -30,8 +31,8 @@ public final class LayoutGuid extends LayoutType<UUID> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result ReadFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
public Result ReadFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col,
|
||||||
OutObject<UUID> value) {
|
Out<UUID> value) {
|
||||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||||
if (!b.get().ReadBit(scope.get().start, col.getNullBit().clone())) {
|
if (!b.get().ReadBit(scope.get().start, col.getNullBit().clone())) {
|
||||||
value.set(null);
|
value.set(null);
|
||||||
@@ -43,8 +44,8 @@ public final class LayoutGuid extends LayoutType<UUID> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result ReadSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
public Result ReadSparse(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||||
OutObject<UUID> value) {
|
Out<UUID> value) {
|
||||||
Result result = PrepareSparseRead(b, edit, this.LayoutCode);
|
Result result = PrepareSparseRead(b, edit, this.LayoutCode);
|
||||||
if (result != Result.Success) {
|
if (result != Result.Success) {
|
||||||
value.set(null);
|
value.set(null);
|
||||||
@@ -56,7 +57,7 @@ public final class LayoutGuid extends LayoutType<UUID> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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) {
|
UUID value) {
|
||||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||||
if (scope.get().immutable) {
|
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,
|
//ORIGINAL LINE: public override Result WriteSparse(ref RowBuffer b, ref RowCursor edit, Guid value,
|
||||||
// UpdateOptions options = UpdateOptions.Upsert)
|
// UpdateOptions options = UpdateOptions.Upsert)
|
||||||
@Override
|
@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) {
|
UpdateOptions options) {
|
||||||
Result result = PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options);
|
Result result = PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options);
|
||||||
if (result != Result.Success) {
|
if (result != Result.Success) {
|
||||||
@@ -84,7 +85,7 @@ public final class LayoutGuid extends LayoutType<UUID> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result WriteSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
public Result WriteSparse(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||||
java.util.UUID value) {
|
java.util.UUID value) {
|
||||||
return WriteSparse(b, edit, value, UpdateOptions.Upsert);
|
return WriteSparse(b, edit, value, UpdateOptions.Upsert);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,8 @@
|
|||||||
|
|
||||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
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.RowBuffer;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
||||||
|
|
||||||
@@ -22,7 +23,7 @@ public abstract class LayoutIndexedScope extends LayoutScope {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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().pathToken = 0;
|
||||||
edit.get().pathOffset = 0;
|
edit.get().pathOffset = 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,8 +4,9 @@
|
|||||||
|
|
||||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
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.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.Result;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
||||||
@@ -28,8 +29,8 @@ public final class LayoutInt16 extends LayoutType<Short> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result ReadFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
public Result ReadFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col,
|
||||||
OutObject<Short> value) {
|
Out<Short> value) {
|
||||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||||
if (!b.get().ReadBit(scope.get().start, col.getNullBit().clone())) {
|
if (!b.get().ReadBit(scope.get().start, col.getNullBit().clone())) {
|
||||||
value.set(0);
|
value.set(0);
|
||||||
@@ -41,8 +42,8 @@ public final class LayoutInt16 extends LayoutType<Short> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result ReadSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
public Result ReadSparse(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||||
OutObject<Short> value) {
|
Out<Short> value) {
|
||||||
Result result = PrepareSparseRead(b, edit, this.LayoutCode);
|
Result result = PrepareSparseRead(b, edit, this.LayoutCode);
|
||||||
if (result != Result.Success) {
|
if (result != Result.Success) {
|
||||||
value.set(0);
|
value.set(0);
|
||||||
@@ -54,7 +55,7 @@ public final class LayoutInt16 extends LayoutType<Short> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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) {
|
short value) {
|
||||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||||
if (scope.get().immutable) {
|
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,
|
//ORIGINAL LINE: public override Result WriteSparse(ref RowBuffer b, ref RowCursor edit, short value,
|
||||||
// UpdateOptions options = UpdateOptions.Upsert)
|
// UpdateOptions options = UpdateOptions.Upsert)
|
||||||
@Override
|
@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) {
|
UpdateOptions options) {
|
||||||
Result result = PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options);
|
Result result = PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options);
|
||||||
if (result != Result.Success) {
|
if (result != Result.Success) {
|
||||||
@@ -82,7 +83,7 @@ public final class LayoutInt16 extends LayoutType<Short> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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);
|
return WriteSparse(b, edit, value, UpdateOptions.Upsert);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4,8 +4,9 @@
|
|||||||
|
|
||||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
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.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.Result;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
||||||
@@ -28,8 +29,8 @@ public final class LayoutInt32 extends LayoutType<Integer> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result ReadFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
public Result ReadFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col,
|
||||||
OutObject<Integer> value) {
|
Out<Integer> value) {
|
||||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||||
if (!b.get().ReadBit(scope.get().start, col.getNullBit().clone())) {
|
if (!b.get().ReadBit(scope.get().start, col.getNullBit().clone())) {
|
||||||
value.set(0);
|
value.set(0);
|
||||||
@@ -41,8 +42,8 @@ public final class LayoutInt32 extends LayoutType<Integer> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result ReadSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
public Result ReadSparse(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||||
OutObject<Integer> value) {
|
Out<Integer> value) {
|
||||||
Result result = LayoutType.PrepareSparseRead(b, edit, this.LayoutCode);
|
Result result = LayoutType.PrepareSparseRead(b, edit, this.LayoutCode);
|
||||||
if (result != Result.Success) {
|
if (result != Result.Success) {
|
||||||
value.set(0);
|
value.set(0);
|
||||||
@@ -54,7 +55,7 @@ public final class LayoutInt32 extends LayoutType<Integer> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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) {
|
int value) {
|
||||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||||
if (scope.get().immutable) {
|
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
|
//ORIGINAL LINE: public override Result WriteSparse(ref RowBuffer b, ref RowCursor edit, int value, UpdateOptions
|
||||||
// options = UpdateOptions.Upsert)
|
// options = UpdateOptions.Upsert)
|
||||||
@Override
|
@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) {
|
UpdateOptions options) {
|
||||||
Result result = LayoutType.PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options);
|
Result result = LayoutType.PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options);
|
||||||
if (result != Result.Success) {
|
if (result != Result.Success) {
|
||||||
@@ -82,7 +83,7 @@ public final class LayoutInt32 extends LayoutType<Integer> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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);
|
return WriteSparse(b, edit, value, UpdateOptions.Upsert);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4,8 +4,9 @@
|
|||||||
|
|
||||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
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.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.Result;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
||||||
@@ -28,8 +29,8 @@ public final class LayoutInt64 extends LayoutType<Long> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result ReadFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
public Result ReadFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col,
|
||||||
OutObject<Long> value) {
|
Out<Long> value) {
|
||||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||||
if (!b.get().ReadBit(scope.get().start, col.getNullBit().clone())) {
|
if (!b.get().ReadBit(scope.get().start, col.getNullBit().clone())) {
|
||||||
value.set(0);
|
value.set(0);
|
||||||
@@ -41,8 +42,8 @@ public final class LayoutInt64 extends LayoutType<Long> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result ReadSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
public Result ReadSparse(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||||
OutObject<Long> value) {
|
Out<Long> value) {
|
||||||
Result result = LayoutType.PrepareSparseRead(b, edit, this.LayoutCode);
|
Result result = LayoutType.PrepareSparseRead(b, edit, this.LayoutCode);
|
||||||
if (result != Result.Success) {
|
if (result != Result.Success) {
|
||||||
value.set(0);
|
value.set(0);
|
||||||
@@ -54,7 +55,7 @@ public final class LayoutInt64 extends LayoutType<Long> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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) {
|
long value) {
|
||||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||||
if (scope.get().immutable) {
|
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,
|
//ORIGINAL LINE: public override Result WriteSparse(ref RowBuffer b, ref RowCursor edit, long value,
|
||||||
// UpdateOptions options = UpdateOptions.Upsert)
|
// UpdateOptions options = UpdateOptions.Upsert)
|
||||||
@Override
|
@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) {
|
UpdateOptions options) {
|
||||||
Result result = LayoutType.PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options);
|
Result result = LayoutType.PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options);
|
||||||
if (result != Result.Success) {
|
if (result != Result.Success) {
|
||||||
@@ -82,7 +83,7 @@ public final class LayoutInt64 extends LayoutType<Long> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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);
|
return WriteSparse(b, edit, value, UpdateOptions.Upsert);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4,8 +4,9 @@
|
|||||||
|
|
||||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
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.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.Result;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
||||||
@@ -28,8 +29,8 @@ public final class LayoutInt8 extends LayoutType<Byte> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result ReadFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
public Result ReadFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col,
|
||||||
OutObject<Byte> value) {
|
Out<Byte> value) {
|
||||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||||
if (!b.get().ReadBit(scope.get().start, col.getNullBit().clone())) {
|
if (!b.get().ReadBit(scope.get().start, col.getNullBit().clone())) {
|
||||||
value.set(0);
|
value.set(0);
|
||||||
@@ -41,8 +42,8 @@ public final class LayoutInt8 extends LayoutType<Byte> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result ReadSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
public Result ReadSparse(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||||
OutObject<Byte> value) {
|
Out<Byte> value) {
|
||||||
Result result = LayoutType.PrepareSparseRead(b, edit, this.LayoutCode);
|
Result result = LayoutType.PrepareSparseRead(b, edit, this.LayoutCode);
|
||||||
if (result != Result.Success) {
|
if (result != Result.Success) {
|
||||||
value.set(0);
|
value.set(0);
|
||||||
@@ -54,7 +55,7 @@ public final class LayoutInt8 extends LayoutType<Byte> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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) {
|
byte value) {
|
||||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||||
if (scope.get().immutable) {
|
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,
|
//ORIGINAL LINE: public override Result WriteSparse(ref RowBuffer b, ref RowCursor edit, sbyte value,
|
||||||
// UpdateOptions options = UpdateOptions.Upsert)
|
// UpdateOptions options = UpdateOptions.Upsert)
|
||||||
@Override
|
@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) {
|
UpdateOptions options) {
|
||||||
Result result = LayoutType.PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options);
|
Result result = LayoutType.PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options);
|
||||||
if (result != Result.Success) {
|
if (result != Result.Success) {
|
||||||
@@ -82,7 +83,7 @@ public final class LayoutInt8 extends LayoutType<Byte> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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);
|
return WriteSparse(b, edit, value, UpdateOptions.Upsert);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4,8 +4,9 @@
|
|||||||
|
|
||||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
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.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.Result;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
||||||
@@ -29,8 +30,8 @@ public final class LayoutMongoDbObjectId extends LayoutType<MongoDbObjectId> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result ReadFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
public Result ReadFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col,
|
||||||
OutObject<MongoDbObjectId> value) {
|
Out<MongoDbObjectId> value) {
|
||||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||||
if (!b.get().ReadBit(scope.get().start, col.getNullBit().clone())) {
|
if (!b.get().ReadBit(scope.get().start, col.getNullBit().clone())) {
|
||||||
value.set(null);
|
value.set(null);
|
||||||
@@ -42,8 +43,8 @@ public final class LayoutMongoDbObjectId extends LayoutType<MongoDbObjectId> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result ReadSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
public Result ReadSparse(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||||
OutObject<MongoDbObjectId> value) {
|
Out<MongoDbObjectId> value) {
|
||||||
Result result = LayoutType.PrepareSparseRead(b, edit, this.LayoutCode);
|
Result result = LayoutType.PrepareSparseRead(b, edit, this.LayoutCode);
|
||||||
if (result != Result.Success) {
|
if (result != Result.Success) {
|
||||||
value.set(null);
|
value.set(null);
|
||||||
@@ -55,7 +56,7 @@ public final class LayoutMongoDbObjectId extends LayoutType<MongoDbObjectId> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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) {
|
MongoDbObjectId value) {
|
||||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||||
if (scope.get().immutable) {
|
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,
|
//ORIGINAL LINE: public override Result WriteSparse(ref RowBuffer b, ref RowCursor edit, MongoDbObjectId value,
|
||||||
// UpdateOptions options = UpdateOptions.Upsert)
|
// UpdateOptions options = UpdateOptions.Upsert)
|
||||||
@Override
|
@Override
|
||||||
public Result WriteSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
public Result WriteSparse(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||||
MongoDbObjectId value, UpdateOptions options) {
|
MongoDbObjectId value, UpdateOptions options) {
|
||||||
Result result = LayoutType.PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options);
|
Result result = LayoutType.PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options);
|
||||||
if (result != Result.Success) {
|
if (result != Result.Success) {
|
||||||
@@ -83,7 +84,7 @@ public final class LayoutMongoDbObjectId extends LayoutType<MongoDbObjectId> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result WriteSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
public Result WriteSparse(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||||
MongoDbObjectId value) {
|
MongoDbObjectId value) {
|
||||||
return WriteSparse(b, edit, value, UpdateOptions.Upsert);
|
return WriteSparse(b, edit, value, UpdateOptions.Upsert);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,8 +4,9 @@
|
|||||||
|
|
||||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
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.RefObject;
|
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.NullValue;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.Result;
|
import com.azure.data.cosmos.serialization.hybridrow.Result;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||||
@@ -34,8 +35,8 @@ public final class LayoutNull extends LayoutType<NullValue> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result ReadFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
public Result ReadFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col,
|
||||||
OutObject<NullValue> value) {
|
Out<NullValue> value) {
|
||||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||||
value.set(NullValue.Default);
|
value.set(NullValue.Default);
|
||||||
if (!b.get().ReadBit(scope.get().start, col.getNullBit().clone())) {
|
if (!b.get().ReadBit(scope.get().start, col.getNullBit().clone())) {
|
||||||
@@ -46,8 +47,8 @@ public final class LayoutNull extends LayoutType<NullValue> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result ReadSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
public Result ReadSparse(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||||
OutObject<NullValue> value) {
|
Out<NullValue> value) {
|
||||||
Result result = PrepareSparseRead(b, edit, this.LayoutCode);
|
Result result = PrepareSparseRead(b, edit, this.LayoutCode);
|
||||||
if (result != Result.Success) {
|
if (result != Result.Success) {
|
||||||
value.set(null);
|
value.set(null);
|
||||||
@@ -59,7 +60,7 @@ public final class LayoutNull extends LayoutType<NullValue> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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) {
|
NullValue value) {
|
||||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||||
if (scope.get().immutable) {
|
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,
|
//ORIGINAL LINE: public override Result WriteSparse(ref RowBuffer b, ref RowCursor edit, NullValue value,
|
||||||
// UpdateOptions options = UpdateOptions.Upsert)
|
// UpdateOptions options = UpdateOptions.Upsert)
|
||||||
@Override
|
@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) {
|
UpdateOptions options) {
|
||||||
Result result = PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options);
|
Result result = PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options);
|
||||||
if (result != Result.Success) {
|
if (result != Result.Success) {
|
||||||
@@ -86,7 +87,7 @@ public final class LayoutNull extends LayoutType<NullValue> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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);
|
return WriteSparse(b, edit, value, UpdateOptions.Upsert);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4,8 +4,9 @@
|
|||||||
|
|
||||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
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.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.Result;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
||||||
@@ -31,14 +32,14 @@ public final class LayoutNullable extends LayoutIndexedScope {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean HasImplicitTypeCode(RefObject<RowCursor> edit) {
|
public boolean HasImplicitTypeCode(Reference<RowCursor> edit) {
|
||||||
checkState(edit.get().index >= 0);
|
checkState(edit.get().index >= 0);
|
||||||
checkState(edit.get().scopeTypeArgs.getCount() == 1);
|
checkState(edit.get().scopeTypeArgs.getCount() == 1);
|
||||||
checkState(edit.get().index == 1);
|
checkState(edit.get().index == 1);
|
||||||
return !LayoutCodeTraits.AlwaysRequiresTypeCode(edit.get().scopeTypeArgs.get(0).getType().LayoutCode);
|
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);
|
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().index == 1 || scope.get().index == 2, "Nullable scopes always point at the value");
|
||||||
checkState(scope.get().scopeTypeArgs.getCount() == 1);
|
checkState(scope.get().scopeTypeArgs.getCount() == 1);
|
||||||
@@ -47,28 +48,28 @@ public final class LayoutNullable extends LayoutIndexedScope {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TypeArgumentList ReadTypeArgumentList(RefObject<RowBuffer> row, int offset,
|
public TypeArgumentList ReadTypeArgumentList(Reference<RowBuffer> row, int offset,
|
||||||
OutObject<Integer> lenInBytes) {
|
Out<Integer> lenInBytes) {
|
||||||
return new TypeArgumentList(new TypeArgument[] { LayoutType.ReadTypeArgument(row, offset, lenInBytes) });
|
return new TypeArgumentList(new TypeArgument[] { LayoutType.ReadTypeArgument(row, offset, lenInBytes) });
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void SetImplicitTypeCode(RefObject<RowCursor> edit) {
|
public void SetImplicitTypeCode(Reference<RowCursor> edit) {
|
||||||
checkState(edit.get().index == 1);
|
checkState(edit.get().index == 1);
|
||||||
edit.get().cellType = edit.get().scopeTypeArgs.get(0).getType();
|
edit.get().cellType = edit.get().scopeTypeArgs.get(0).getType();
|
||||||
edit.get().cellTypeArgs = edit.get().scopeTypeArgs.get(0).getTypeArgs().clone();
|
edit.get().cellTypeArgs = edit.get().scopeTypeArgs.get(0).getTypeArgs().clone();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Result WriteScope(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
public Result WriteScope(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||||
TypeArgumentList typeArgs, boolean hasValue, OutObject<RowCursor> value) {
|
TypeArgumentList typeArgs, boolean hasValue, Out<RowCursor> value) {
|
||||||
return WriteScope(b, edit, typeArgs, hasValue, value, UpdateOptions.Upsert);
|
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:
|
//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
|
//ORIGINAL LINE: public Result WriteScope(ref RowBuffer b, ref RowCursor edit, TypeArgumentList typeArgs, bool
|
||||||
// hasValue, out RowCursor value, UpdateOptions options = UpdateOptions.Upsert)
|
// hasValue, out RowCursor value, UpdateOptions options = UpdateOptions.Upsert)
|
||||||
public Result WriteScope(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
public Result WriteScope(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||||
TypeArgumentList typeArgs, boolean hasValue, OutObject<RowCursor> value,
|
TypeArgumentList typeArgs, boolean hasValue, Out<RowCursor> value,
|
||||||
UpdateOptions options) {
|
UpdateOptions options) {
|
||||||
Result result = LayoutType.PrepareSparseWrite(b, edit, new TypeArgument(this, typeArgs.clone()), options);
|
Result result = LayoutType.PrepareSparseWrite(b, edit, new TypeArgument(this, typeArgs.clone()), options);
|
||||||
if (result != Result.Success) {
|
if (result != Result.Success) {
|
||||||
@@ -81,8 +82,8 @@ public final class LayoutNullable extends LayoutIndexedScope {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result WriteScope(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
public Result WriteScope(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||||
TypeArgumentList typeArgs, OutObject<RowCursor> value) {
|
TypeArgumentList typeArgs, Out<RowCursor> value) {
|
||||||
return WriteScope(b, edit, typeArgs, value, UpdateOptions.Upsert);
|
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
|
//ORIGINAL LINE: public override Result WriteScope(ref RowBuffer b, ref RowCursor edit, TypeArgumentList
|
||||||
// typeArgs, out RowCursor value, UpdateOptions options = UpdateOptions.Upsert)
|
// typeArgs, out RowCursor value, UpdateOptions options = UpdateOptions.Upsert)
|
||||||
@Override
|
@Override
|
||||||
public Result WriteScope(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
public Result WriteScope(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||||
TypeArgumentList typeArgs, OutObject<RowCursor> value, UpdateOptions options) {
|
TypeArgumentList typeArgs, Out<RowCursor> value, UpdateOptions options) {
|
||||||
return this.WriteScope(b, edit, typeArgs.clone(), true, value, options);
|
return this.WriteScope(b, edit, typeArgs.clone(), true, value, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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);
|
checkState(value.getCount() == 1);
|
||||||
row.get().WriteSparseTypeCode(offset, this.LayoutCode);
|
row.get().WriteSparseTypeCode(offset, this.LayoutCode);
|
||||||
int lenInBytes = (com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutCode.SIZE / Byte.SIZE);
|
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;
|
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.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.Result;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
||||||
@@ -30,8 +31,8 @@ public final class LayoutObject extends LayoutPropertyScope {
|
|||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result WriteScope(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
public Result WriteScope(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||||
TypeArgumentList typeArgs, OutObject<RowCursor> value) {
|
TypeArgumentList typeArgs, Out<RowCursor> value) {
|
||||||
return WriteScope(b, edit, typeArgs, value, UpdateOptions.Upsert);
|
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
|
//ORIGINAL LINE: public override Result WriteScope(ref RowBuffer b, ref RowCursor edit, TypeArgumentList
|
||||||
// typeArgs, out RowCursor value, UpdateOptions options = UpdateOptions.Upsert)
|
// typeArgs, out RowCursor value, UpdateOptions options = UpdateOptions.Upsert)
|
||||||
@Override
|
@Override
|
||||||
public Result WriteScope(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
public Result WriteScope(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||||
TypeArgumentList typeArgs, OutObject<RowCursor> value, UpdateOptions options) {
|
TypeArgumentList typeArgs, Out<RowCursor> value, UpdateOptions options) {
|
||||||
Result result = LayoutType.PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options);
|
Result result = LayoutType.PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options);
|
||||||
if (result != Result.Success) {
|
if (result != Result.Success) {
|
||||||
value.set(null);
|
value.set(null);
|
||||||
|
|||||||
@@ -12,12 +12,12 @@ import static com.google.common.base.Preconditions.checkState;
|
|||||||
import static com.google.common.base.Strings.lenientFormat;
|
import static com.google.common.base.Strings.lenientFormat;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An implementation of <see cref="LayoutResolver" /> which dynamically compiles schema from
|
* An implementation of {@link LayoutResolver} which dynamically compiles schema from
|
||||||
* a <see cref="Namespace" />.
|
* a {@link Namespace}.
|
||||||
* <p>
|
* <p>
|
||||||
* <p>
|
* <p>
|
||||||
* This resolver assumes that <see cref="Schema" /> within the <see cref="Namespace" /> have
|
* This resolver assumes that {@link Schema} within the {@link Namespace} have
|
||||||
* their <see cref="Schema.SchemaId" /> properly populated. The resolver caches compiled schema.
|
* their {@link Schema.SchemaId} properly populated. The resolver caches compiled schema.
|
||||||
* <p>
|
* <p>
|
||||||
* All members of this class are multi-thread safe.
|
* 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
|
// TODO: C# TO JAVA CONVERTER: There is no Java ConcurrentHashMap equivalent to this .NET
|
||||||
// ConcurrentDictionary method:
|
// ConcurrentDictionary method:
|
||||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
|
// 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)) {
|
if (this.layoutCache.TryGetValue(schemaId.getId(), out layout)) {
|
||||||
return layout;
|
return layout;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,8 +4,9 @@
|
|||||||
|
|
||||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
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.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.Result;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
||||||
@@ -51,7 +52,7 @@ public abstract class LayoutScope extends LayoutType {
|
|||||||
return false;
|
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);
|
Result result = LayoutType.PrepareSparseDelete(b, edit, this.LayoutCode);
|
||||||
if (result != Result.Success) {
|
if (result != Result.Success) {
|
||||||
return result;
|
return result;
|
||||||
@@ -68,12 +69,12 @@ public abstract class LayoutScope extends LayoutType {
|
|||||||
* @param edit
|
* @param edit
|
||||||
* @return True if the type code is implied (not written), false otherwise.
|
* @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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public final Result ReadScope(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
public final Result ReadScope(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||||
OutObject<RowCursor> value) {
|
Out<RowCursor> value) {
|
||||||
Result result = LayoutType.PrepareSparseRead(b, edit, this.LayoutCode);
|
Result result = LayoutType.PrepareSparseRead(b, edit, this.LayoutCode);
|
||||||
if (result != Result.Success) {
|
if (result != Result.Success) {
|
||||||
value.set(null);
|
value.set(null);
|
||||||
@@ -85,32 +86,32 @@ public abstract class LayoutScope extends LayoutType {
|
|||||||
return Result.Success;
|
return Result.Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ReadSparsePath(RefObject<RowBuffer> row, RefObject<RowCursor> edit) {
|
public void ReadSparsePath(Reference<RowBuffer> row, Reference<RowCursor> edit) {
|
||||||
int pathLenInBytes;
|
int pathLenInBytes;
|
||||||
OutObject<Integer> tempOut_pathLenInBytes = new OutObject<Integer>();
|
Out<Integer> tempOut_pathLenInBytes = new Out<Integer>();
|
||||||
OutObject<Integer> tempOut_pathOffset = new OutObject<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().pathToken = row.get().ReadSparsePathLen(edit.get().layout, edit.get().valueOffset, tempOut_pathLenInBytes, tempOut_pathOffset);
|
||||||
edit.get().argValue.pathOffset = tempOut_pathOffset.get();
|
edit.get().argValue.pathOffset = tempOut_pathOffset.get();
|
||||||
pathLenInBytes = tempOut_pathLenInBytes.get();
|
pathLenInBytes = tempOut_pathLenInBytes.get();
|
||||||
edit.get().valueOffset += pathLenInBytes;
|
edit.get().valueOffset += pathLenInBytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetImplicitTypeCode(RefObject<RowCursor> edit) {
|
public void SetImplicitTypeCode(Reference<RowCursor> edit) {
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract Result WriteScope(
|
public abstract Result WriteScope(
|
||||||
RefObject<RowBuffer> b, RefObject<RowCursor> scope, TypeArgumentList typeArgs,
|
Reference<RowBuffer> b, Reference<RowCursor> scope, TypeArgumentList typeArgs,
|
||||||
OutObject<RowCursor> value);
|
Out<RowCursor> value);
|
||||||
|
|
||||||
//C# TO JAVA CONVERTER NOTE: Java does not support optional parameters. Overloaded method(s) are created above:
|
//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
|
//ORIGINAL LINE: public abstract Result WriteScope(ref RowBuffer b, ref RowCursor scope, TypeArgumentList
|
||||||
// typeArgs, out RowCursor value, UpdateOptions options = UpdateOptions.Upsert);
|
// typeArgs, out RowCursor value, UpdateOptions options = UpdateOptions.Upsert);
|
||||||
public abstract Result WriteScope(RefObject<RowBuffer> b, RefObject<RowCursor> scope,
|
public abstract Result WriteScope(Reference<RowBuffer> b, Reference<RowCursor> scope,
|
||||||
TypeArgumentList typeArgs, OutObject<RowCursor> value,
|
TypeArgumentList typeArgs, Out<RowCursor> value,
|
||||||
UpdateOptions options);
|
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) {
|
TypeArgumentList typeArgs, TContext context, WriterFunc<TContext> func) {
|
||||||
return WriteScope(b, scope, typeArgs, context, func, UpdateOptions.Upsert);
|
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,
|
//ORIGINAL LINE: public virtual Result WriteScope<TContext>(ref RowBuffer b, ref RowCursor scope,
|
||||||
// TypeArgumentList typeArgs, TContext context, WriterFunc<TContext> func, UpdateOptions options = UpdateOptions
|
// TypeArgumentList typeArgs, TContext context, WriterFunc<TContext> func, UpdateOptions options = UpdateOptions
|
||||||
// .Upsert)
|
// .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,
|
TypeArgumentList typeArgs, TContext context, WriterFunc<TContext> func,
|
||||||
UpdateOptions options) {
|
UpdateOptions options) {
|
||||||
RowCursor childScope;
|
RowCursor childScope;
|
||||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
|
// 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);
|
Result r = this.WriteScope(b, scope, typeArgs.clone(), out childScope, options);
|
||||||
if (r != Result.Success) {
|
if (r != Result.Success) {
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
RefObject<RowCursor> tempRef_childScope =
|
Reference<RowCursor> tempReference_childScope =
|
||||||
new RefObject<RowCursor>(childScope);
|
new Reference<RowCursor>(childScope);
|
||||||
// TODO: C# TO JAVA CONVERTER: The following line could not be converted:
|
// 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;
|
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) {
|
if (r != Result.Success) {
|
||||||
this.DeleteScope(b, scope);
|
this.DeleteScope(b, scope);
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
RefObject<RowCursor> tempRef_childScope2 =
|
Reference<RowCursor> tempReference_childScope2 =
|
||||||
new RefObject<RowCursor>(childScope);
|
new Reference<RowCursor>(childScope);
|
||||||
RowCursorExtensions.Skip(scope.get().clone(), b,
|
RowCursorExtensions.Skip(scope.get().clone(), b,
|
||||||
tempRef_childScope2);
|
tempReference_childScope2);
|
||||||
childScope = tempRef_childScope2.get();
|
childScope = tempReference_childScope2.get();
|
||||||
return Result.Success;
|
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>
|
* <typeparam name="TContext">The type of the context value passed by the caller.</typeparam>
|
||||||
*
|
*
|
||||||
* @param b The row to write to.
|
* @param b The row to write to.
|
||||||
@@ -159,6 +160,6 @@ public abstract class LayoutScope extends LayoutType {
|
|||||||
*/
|
*/
|
||||||
@FunctionalInterface
|
@FunctionalInterface
|
||||||
public interface WriterFunc<TContext> {
|
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;
|
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.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.Result;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
||||||
@@ -30,15 +31,15 @@ public final class LayoutTagged extends LayoutIndexedScope {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean HasImplicitTypeCode(RefObject<RowCursor> edit) {
|
public boolean HasImplicitTypeCode(Reference<RowCursor> edit) {
|
||||||
checkArgument(edit.get().index >= 0);
|
checkArgument(edit.get().index >= 0);
|
||||||
checkArgument(edit.get().scopeTypeArgs.getCount() > edit.get().index);
|
checkArgument(edit.get().scopeTypeArgs.getCount() > edit.get().index);
|
||||||
return !LayoutCodeTraits.AlwaysRequiresTypeCode(edit.get().scopeTypeArgs.get(edit.get().index).getType().LayoutCode);
|
return !LayoutCodeTraits.AlwaysRequiresTypeCode(edit.get().scopeTypeArgs.get(edit.get().index).getType().LayoutCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TypeArgumentList ReadTypeArgumentList(RefObject<RowBuffer> row, int offset,
|
public TypeArgumentList ReadTypeArgumentList(Reference<RowBuffer> row, int offset,
|
||||||
OutObject<Integer> lenInBytes) {
|
Out<Integer> lenInBytes) {
|
||||||
TypeArgument[] retval = new TypeArgument[2];
|
TypeArgument[] retval = new TypeArgument[2];
|
||||||
retval[0] = new TypeArgument(UInt8, TypeArgumentList.Empty);
|
retval[0] = new TypeArgument(UInt8, TypeArgumentList.Empty);
|
||||||
retval[1] = ReadTypeArgument(row, offset, lenInBytes);
|
retval[1] = ReadTypeArgument(row, offset, lenInBytes);
|
||||||
@@ -46,14 +47,14 @@ public final class LayoutTagged extends LayoutIndexedScope {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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().cellType = edit.get().scopeTypeArgs.get(edit.get().index).getType();
|
||||||
edit.get().cellTypeArgs = edit.get().scopeTypeArgs.get(edit.get().index).getTypeArgs().clone();
|
edit.get().cellTypeArgs = edit.get().scopeTypeArgs.get(edit.get().index).getTypeArgs().clone();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result WriteScope(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
public Result WriteScope(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||||
TypeArgumentList typeArgs, OutObject<RowCursor> value) {
|
TypeArgumentList typeArgs, Out<RowCursor> value) {
|
||||||
return WriteScope(b, edit, typeArgs, value, UpdateOptions.Upsert);
|
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
|
//ORIGINAL LINE: public override Result WriteScope(ref RowBuffer b, ref RowCursor edit, TypeArgumentList
|
||||||
// typeArgs, out RowCursor value, UpdateOptions options = UpdateOptions.Upsert)
|
// typeArgs, out RowCursor value, UpdateOptions options = UpdateOptions.Upsert)
|
||||||
@Override
|
@Override
|
||||||
public Result WriteScope(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
public Result WriteScope(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||||
TypeArgumentList typeArgs, OutObject<RowCursor> value, UpdateOptions options) {
|
TypeArgumentList typeArgs, Out<RowCursor> value, UpdateOptions options) {
|
||||||
Result result = PrepareSparseWrite(b, edit, new TypeArgument(this, typeArgs.clone()), options);
|
Result result = PrepareSparseWrite(b, edit, new TypeArgument(this, typeArgs.clone()), options);
|
||||||
if (result != Result.Success) {
|
if (result != Result.Success) {
|
||||||
value.set(null);
|
value.set(null);
|
||||||
@@ -74,7 +75,7 @@ public final class LayoutTagged extends LayoutIndexedScope {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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);
|
checkArgument(value.getCount() == 2);
|
||||||
row.get().WriteSparseTypeCode(offset, this.LayoutCode);
|
row.get().WriteSparseTypeCode(offset, this.LayoutCode);
|
||||||
int lenInBytes = (com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutCode.SIZE / Byte.SIZE);
|
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;
|
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.RefObject;
|
import com.azure.data.cosmos.core.Reference;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.Result;
|
import com.azure.data.cosmos.serialization.hybridrow.Result;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
||||||
@@ -35,21 +35,21 @@ public final class LayoutTagged2 extends LayoutIndexedScope {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean HasImplicitTypeCode(RefObject<RowCursor> edit) {
|
public boolean HasImplicitTypeCode(Reference<RowCursor> edit) {
|
||||||
checkState(edit.get().index >= 0);
|
checkState(edit.get().index >= 0);
|
||||||
checkState(edit.get().scopeTypeArgs.getCount() > edit.get().index);
|
checkState(edit.get().scopeTypeArgs.getCount() > edit.get().index);
|
||||||
return !LayoutCodeTraits.AlwaysRequiresTypeCode(edit.get().scopeTypeArgs.get(edit.get().index).getType().LayoutCode);
|
return !LayoutCodeTraits.AlwaysRequiresTypeCode(edit.get().scopeTypeArgs.get(edit.get().index).getType().LayoutCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TypeArgumentList ReadTypeArgumentList(RefObject<RowBuffer> row, int offset,
|
public TypeArgumentList ReadTypeArgumentList(Reference<RowBuffer> row, int offset,
|
||||||
OutObject<Integer> lenInBytes) {
|
Out<Integer> lenInBytes) {
|
||||||
lenInBytes.set(0);
|
lenInBytes.set(0);
|
||||||
TypeArgument[] retval = new TypeArgument[3];
|
TypeArgument[] retval = new TypeArgument[3];
|
||||||
retval[0] = new TypeArgument(UInt8, TypeArgumentList.Empty);
|
retval[0] = new TypeArgument(UInt8, TypeArgumentList.Empty);
|
||||||
for (int i = 1; i < 3; i++) {
|
for (int i = 1; i < 3; i++) {
|
||||||
int itemLenInBytes;
|
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);
|
retval[i] = ReadTypeArgument(row, offset + lenInBytes.get(), tempOut_itemLenInBytes);
|
||||||
itemLenInBytes = tempOut_itemLenInBytes.get();
|
itemLenInBytes = tempOut_itemLenInBytes.get();
|
||||||
lenInBytes.set(lenInBytes.get() + itemLenInBytes);
|
lenInBytes.set(lenInBytes.get() + itemLenInBytes);
|
||||||
@@ -59,14 +59,14 @@ public final class LayoutTagged2 extends LayoutIndexedScope {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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().cellType = edit.get().scopeTypeArgs.get(edit.get().index).getType();
|
||||||
edit.get().cellTypeArgs = edit.get().scopeTypeArgs.get(edit.get().index).getTypeArgs().clone();
|
edit.get().cellTypeArgs = edit.get().scopeTypeArgs.get(edit.get().index).getTypeArgs().clone();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result WriteScope(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
public Result WriteScope(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||||
TypeArgumentList typeArgs, OutObject<RowCursor> value) {
|
TypeArgumentList typeArgs, Out<RowCursor> value) {
|
||||||
return WriteScope(b, edit, typeArgs, value, UpdateOptions.Upsert);
|
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
|
//ORIGINAL LINE: public override Result WriteScope(ref RowBuffer b, ref RowCursor edit, TypeArgumentList
|
||||||
// typeArgs, out RowCursor value, UpdateOptions options = UpdateOptions.Upsert)
|
// typeArgs, out RowCursor value, UpdateOptions options = UpdateOptions.Upsert)
|
||||||
@Override
|
@Override
|
||||||
public Result WriteScope(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
public Result WriteScope(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||||
TypeArgumentList typeArgs, OutObject<RowCursor> value, UpdateOptions options) {
|
TypeArgumentList typeArgs, Out<RowCursor> value, UpdateOptions options) {
|
||||||
Result result = PrepareSparseWrite(b, edit, new TypeArgument(this, typeArgs.clone()), options);
|
Result result = PrepareSparseWrite(b, edit, new TypeArgument(this, typeArgs.clone()), options);
|
||||||
if (result != Result.Success) {
|
if (result != Result.Success) {
|
||||||
value.set(null);
|
value.set(null);
|
||||||
@@ -87,7 +87,7 @@ public final class LayoutTagged2 extends LayoutIndexedScope {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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);
|
checkState(value.getCount() == 3);
|
||||||
row.get().WriteSparseTypeCode(offset, this.LayoutCode);
|
row.get().WriteSparseTypeCode(offset, this.LayoutCode);
|
||||||
int lenInBytes = (com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutCode.SIZE / Byte.SIZE);
|
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;
|
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.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.Result;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
||||||
@@ -37,13 +38,13 @@ public final class LayoutTuple extends LayoutIndexedScope {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TypeArgumentList ReadTypeArgumentList(RefObject<RowBuffer> row, int offset,
|
public TypeArgumentList ReadTypeArgumentList(Reference<RowBuffer> row, int offset,
|
||||||
OutObject<Integer> lenInBytes) {
|
Out<Integer> lenInBytes) {
|
||||||
int numTypeArgs = row.get().intValue().Read7BitEncodedUInt(offset, lenInBytes);
|
int numTypeArgs = row.get().intValue().Read7BitEncodedUInt(offset, lenInBytes);
|
||||||
TypeArgument[] retval = new TypeArgument[numTypeArgs];
|
TypeArgument[] retval = new TypeArgument[numTypeArgs];
|
||||||
for (int i = 0; i < numTypeArgs; i++) {
|
for (int i = 0; i < numTypeArgs; i++) {
|
||||||
int itemLenInBytes;
|
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);
|
retval[i] = ReadTypeArgument(row, offset + lenInBytes.get(), tempOut_itemLenInBytes);
|
||||||
itemLenInBytes = tempOut_itemLenInBytes.get();
|
itemLenInBytes = tempOut_itemLenInBytes.get();
|
||||||
lenInBytes.set(lenInBytes.get() + itemLenInBytes);
|
lenInBytes.set(lenInBytes.get() + itemLenInBytes);
|
||||||
@@ -53,8 +54,8 @@ public final class LayoutTuple extends LayoutIndexedScope {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result WriteScope(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
public Result WriteScope(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||||
TypeArgumentList typeArgs, OutObject<RowCursor> value) {
|
TypeArgumentList typeArgs, Out<RowCursor> value) {
|
||||||
return WriteScope(b, edit, typeArgs, value, UpdateOptions.Upsert);
|
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
|
//ORIGINAL LINE: public override Result WriteScope(ref RowBuffer b, ref RowCursor edit, TypeArgumentList
|
||||||
// typeArgs, out RowCursor value, UpdateOptions options = UpdateOptions.Upsert)
|
// typeArgs, out RowCursor value, UpdateOptions options = UpdateOptions.Upsert)
|
||||||
@Override
|
@Override
|
||||||
public Result WriteScope(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
public Result WriteScope(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||||
TypeArgumentList typeArgs, OutObject<RowCursor> value, UpdateOptions options) {
|
TypeArgumentList typeArgs, Out<RowCursor> value, UpdateOptions options) {
|
||||||
Result result = PrepareSparseWrite(b, edit, new TypeArgument(this, typeArgs.clone()), options);
|
Result result = PrepareSparseWrite(b, edit, new TypeArgument(this, typeArgs.clone()), options);
|
||||||
if (result != Result.Success) {
|
if (result != Result.Success) {
|
||||||
value.set(null);
|
value.set(null);
|
||||||
@@ -75,7 +76,7 @@ public final class LayoutTuple extends LayoutIndexedScope {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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().WriteSparseTypeCode(offset, this.LayoutCode);
|
||||||
int lenInBytes = (com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutCode.SIZE / Byte.SIZE);
|
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:
|
//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;
|
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.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.Result;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
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.
|
* 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:
|
// TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes:
|
||||||
//ORIGINAL LINE: [DebuggerDisplay("{" + nameof(LayoutType.Name) + "}")] public abstract class LayoutType : ILayoutType
|
//ORIGINAL LINE: [DebuggerDisplay("{" + nameof(LayoutType.Name) + "}")] public abstract class LayoutType : ILayoutType
|
||||||
@@ -269,7 +270,7 @@ public abstract class LayoutType implements ILayoutType {
|
|||||||
public int Size;
|
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) {
|
public LayoutType(LayoutCode code, boolean immutable, int size) {
|
||||||
this.LayoutCode = code;
|
this.LayoutCode = code;
|
||||||
@@ -343,7 +344,7 @@ public abstract class LayoutType implements ILayoutType {
|
|||||||
* @param code The expected type of the field.
|
* @param code The expected type of the field.
|
||||||
* @return Success if the delete is permitted, the error code otherwise.
|
* @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) {
|
LayoutCode code) {
|
||||||
if (edit.get().scopeType.IsFixedArity) {
|
if (edit.get().scopeType.IsFixedArity) {
|
||||||
return Result.TypeConstraint;
|
return Result.TypeConstraint;
|
||||||
@@ -373,11 +374,11 @@ public abstract class LayoutType implements ILayoutType {
|
|||||||
* @return Success if the move is permitted, the error code otherwise.
|
* @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.
|
* The source field is delete if the move prepare fails with a destination error.
|
||||||
*/
|
*/
|
||||||
public static Result PrepareSparseMove(RefObject<RowBuffer> b,
|
public static Result PrepareSparseMove(Reference<RowBuffer> b,
|
||||||
RefObject<RowCursor> destinationScope,
|
Reference<RowCursor> destinationScope,
|
||||||
LayoutScope destinationCode, TypeArgument elementType,
|
LayoutScope destinationCode, TypeArgument elementType,
|
||||||
RefObject<RowCursor> srcEdit, UpdateOptions options,
|
Reference<RowCursor> srcEdit, UpdateOptions options,
|
||||||
OutObject<RowCursor> dstEdit) {
|
Out<RowCursor> dstEdit) {
|
||||||
checkArgument(destinationScope.get().scopeType == destinationCode);
|
checkArgument(destinationScope.get().scopeType == destinationCode);
|
||||||
checkArgument(destinationScope.get().index == 0, "Can only insert into a edit at the root");
|
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.
|
* @param code The expected type of the field.
|
||||||
* @return Success if the read is permitted, the error code otherwise.
|
* @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) {
|
LayoutCode code) {
|
||||||
if (!edit.get().exists) {
|
if (!edit.get().exists) {
|
||||||
return Result.NotFound;
|
return Result.NotFound;
|
||||||
@@ -458,7 +459,7 @@ public abstract class LayoutType implements ILayoutType {
|
|||||||
* @param options The write options.
|
* @param options The write options.
|
||||||
* @return Success if the write is permitted, the error code otherwise.
|
* @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) {
|
TypeArgument typeArg, UpdateOptions options) {
|
||||||
if (edit.get().immutable || (edit.get().scopeType.IsUniqueScope && !edit.get().deferUniqueIndex)) {
|
if (edit.get().immutable || (edit.get().scopeType.IsUniqueScope && !edit.get().deferUniqueIndex)) {
|
||||||
return Result.InsufficientPermissions;
|
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:
|
// 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)
|
//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);
|
LayoutType itemCode = row.get().ReadSparseTypeCode(offset);
|
||||||
int argsLenInBytes;
|
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();
|
TypeArgumentList itemTypeArgs = itemCode.ReadTypeArgumentList(row, offset + (com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutCode.SIZE / Byte.SIZE), tempOut_argsLenInBytes).clone();
|
||||||
argsLenInBytes = tempOut_argsLenInBytes.get();
|
argsLenInBytes = tempOut_argsLenInBytes.get();
|
||||||
lenInBytes.set((com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutCode.SIZE / Byte.SIZE) + argsLenInBytes);
|
lenInBytes.set((com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutCode.SIZE / Byte.SIZE) + argsLenInBytes);
|
||||||
return new TypeArgument(itemCode, itemTypeArgs.clone());
|
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);
|
lenInBytes.set(0);
|
||||||
return TypeArgumentList.Empty;
|
return TypeArgumentList.Empty;
|
||||||
}
|
}
|
||||||
@@ -521,7 +522,7 @@ public abstract class LayoutType implements ILayoutType {
|
|||||||
return (T)this;
|
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);
|
row.get().WriteSparseTypeCode(offset, this.LayoutCode);
|
||||||
return (com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutCode.SIZE / Byte.SIZE);
|
return (com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutCode.SIZE / Byte.SIZE);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,8 +4,9 @@
|
|||||||
|
|
||||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
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.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.Result;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
||||||
@@ -17,11 +18,11 @@ import static com.google.common.base.Preconditions.checkArgument;
|
|||||||
* <typeparamref name="T" />.
|
* <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
|
* methods for manipulating hybrid row fields of a particular type, and properties that describe the
|
||||||
* layout of fields of that type.
|
* layout of fields of that type.
|
||||||
* <para />
|
* <para />
|
||||||
* <see cref="LayoutType{T}" /> is immutable.
|
* {@link LayoutType{T}} is immutable.
|
||||||
*/
|
*/
|
||||||
public abstract class LayoutType<T> extends LayoutType {
|
public abstract class LayoutType<T> extends LayoutType {
|
||||||
private TypeArgument typeArg = new TypeArgument();
|
private TypeArgument typeArg = new TypeArgument();
|
||||||
@@ -31,7 +32,7 @@ public abstract class LayoutType<T> extends LayoutType {
|
|||||||
this.typeArg = new TypeArgument(this);
|
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) {
|
LayoutColumn col) {
|
||||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||||
if (scope.get().immutable) {
|
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
|
* 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.
|
* 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);
|
Result result = LayoutType.PrepareSparseDelete(b, edit, this.LayoutCode);
|
||||||
if (result != Result.Success) {
|
if (result != Result.Success) {
|
||||||
return result;
|
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
|
* 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.
|
* 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) {
|
LayoutColumn col) {
|
||||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||||
if (scope.get().immutable) {
|
if (scope.get().immutable) {
|
||||||
@@ -87,7 +88,7 @@ public abstract class LayoutType<T> extends LayoutType {
|
|||||||
return Result.Success;
|
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) {
|
LayoutColumn col) {
|
||||||
if (!b.get().ReadBit(scope.get().start, col.getNullBit().clone())) {
|
if (!b.get().ReadBit(scope.get().start, col.getNullBit().clone())) {
|
||||||
return Result.NotFound;
|
return Result.NotFound;
|
||||||
@@ -96,28 +97,28 @@ public abstract class LayoutType<T> extends LayoutType {
|
|||||||
return Result.Success;
|
return Result.Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract Result ReadFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope,
|
public abstract Result ReadFixed(Reference<RowBuffer> b, Reference<RowCursor> scope,
|
||||||
LayoutColumn col, OutObject<T> value);
|
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
|
public Result ReadVariable(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col
|
||||||
, OutObject<T> value) {
|
, Out<T> value) {
|
||||||
value.set(null);
|
value.set(null);
|
||||||
return Result.Failure;
|
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);
|
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:
|
//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
|
//ORIGINAL LINE: public abstract Result WriteSparse(ref RowBuffer b, ref RowCursor edit, T value, UpdateOptions
|
||||||
// options = UpdateOptions.Upsert);
|
// 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) {
|
LayoutColumn col, T value) {
|
||||||
return Result.Failure;
|
return Result.Failure;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,8 +4,9 @@
|
|||||||
|
|
||||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
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.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.Result;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
||||||
@@ -28,27 +29,27 @@ public final class LayoutTypedArray extends LayoutIndexedScope {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean HasImplicitTypeCode(RefObject<RowCursor> edit) {
|
public boolean HasImplicitTypeCode(Reference<RowCursor> edit) {
|
||||||
checkState(edit.get().index >= 0);
|
checkState(edit.get().index >= 0);
|
||||||
checkState(edit.get().scopeTypeArgs.getCount() == 1);
|
checkState(edit.get().scopeTypeArgs.getCount() == 1);
|
||||||
return !LayoutCodeTraits.AlwaysRequiresTypeCode(edit.get().scopeTypeArgs.get(0).getType().LayoutCode);
|
return !LayoutCodeTraits.AlwaysRequiresTypeCode(edit.get().scopeTypeArgs.get(0).getType().LayoutCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TypeArgumentList ReadTypeArgumentList(RefObject<RowBuffer> row, int offset,
|
public TypeArgumentList ReadTypeArgumentList(Reference<RowBuffer> row, int offset,
|
||||||
OutObject<Integer> lenInBytes) {
|
Out<Integer> lenInBytes) {
|
||||||
return new TypeArgumentList(new TypeArgument[] { LayoutType.ReadTypeArgument(row, offset, lenInBytes) });
|
return new TypeArgumentList(new TypeArgument[] { LayoutType.ReadTypeArgument(row, offset, lenInBytes) });
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void SetImplicitTypeCode(RefObject<RowCursor> edit) {
|
public void SetImplicitTypeCode(Reference<RowCursor> edit) {
|
||||||
edit.get().cellType = edit.get().scopeTypeArgs.get(0).getType();
|
edit.get().cellType = edit.get().scopeTypeArgs.get(0).getType();
|
||||||
edit.get().cellTypeArgs = edit.get().scopeTypeArgs.get(0).getTypeArgs().clone();
|
edit.get().cellTypeArgs = edit.get().scopeTypeArgs.get(0).getTypeArgs().clone();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result WriteScope(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
public Result WriteScope(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||||
TypeArgumentList typeArgs, OutObject<RowCursor> value) {
|
TypeArgumentList typeArgs, Out<RowCursor> value) {
|
||||||
return WriteScope(b, edit, typeArgs, value, UpdateOptions.Upsert);
|
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
|
//ORIGINAL LINE: public override Result WriteScope(ref RowBuffer b, ref RowCursor edit, TypeArgumentList
|
||||||
// typeArgs, out RowCursor value, UpdateOptions options = UpdateOptions.Upsert)
|
// typeArgs, out RowCursor value, UpdateOptions options = UpdateOptions.Upsert)
|
||||||
@Override
|
@Override
|
||||||
public Result WriteScope(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
public Result WriteScope(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||||
TypeArgumentList typeArgs, OutObject<RowCursor> value, UpdateOptions options) {
|
TypeArgumentList typeArgs, Out<RowCursor> value, UpdateOptions options) {
|
||||||
Result result = LayoutType.PrepareSparseWrite(b, edit, new TypeArgument(this, typeArgs.clone()), options);
|
Result result = LayoutType.PrepareSparseWrite(b, edit, new TypeArgument(this, typeArgs.clone()), options);
|
||||||
if (result != Result.Success) {
|
if (result != Result.Success) {
|
||||||
value.set(null);
|
value.set(null);
|
||||||
@@ -69,7 +70,7 @@ public final class LayoutTypedArray extends LayoutIndexedScope {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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);
|
checkState(value.getCount() == 1);
|
||||||
row.get().WriteSparseTypeCode(offset, this.LayoutCode);
|
row.get().WriteSparseTypeCode(offset, this.LayoutCode);
|
||||||
int lenInBytes = (com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutCode.SIZE / Byte.SIZE);
|
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;
|
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.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.Result;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
||||||
@@ -34,24 +35,24 @@ public final class LayoutTypedMap extends LayoutUniqueScope {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TypeArgument FieldType(RefObject<RowCursor> scope) {
|
public TypeArgument FieldType(Reference<RowCursor> scope) {
|
||||||
return new TypeArgument(scope.get().scopeType.Immutable ? ImmutableTypedTuple :
|
return new TypeArgument(scope.get().scopeType.Immutable ? ImmutableTypedTuple :
|
||||||
TypedTuple, scope.get().scopeTypeArgs.clone());
|
TypedTuple, scope.get().scopeTypeArgs.clone());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean HasImplicitTypeCode(RefObject<RowCursor> edit) {
|
public boolean HasImplicitTypeCode(Reference<RowCursor> edit) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TypeArgumentList ReadTypeArgumentList(RefObject<RowBuffer> row, int offset,
|
public TypeArgumentList ReadTypeArgumentList(Reference<RowBuffer> row, int offset,
|
||||||
OutObject<Integer> lenInBytes) {
|
Out<Integer> lenInBytes) {
|
||||||
lenInBytes.set(0);
|
lenInBytes.set(0);
|
||||||
TypeArgument[] retval = new TypeArgument[2];
|
TypeArgument[] retval = new TypeArgument[2];
|
||||||
for (int i = 0; i < 2; i++) {
|
for (int i = 0; i < 2; i++) {
|
||||||
int itemLenInBytes;
|
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);
|
retval[i] = ReadTypeArgument(row, offset + lenInBytes.get(), tempOut_itemLenInBytes);
|
||||||
itemLenInBytes = tempOut_itemLenInBytes.get();
|
itemLenInBytes = tempOut_itemLenInBytes.get();
|
||||||
lenInBytes.set(lenInBytes.get() + itemLenInBytes);
|
lenInBytes.set(lenInBytes.get() + itemLenInBytes);
|
||||||
@@ -61,15 +62,15 @@ public final class LayoutTypedMap extends LayoutUniqueScope {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void SetImplicitTypeCode(RefObject<RowCursor> edit) {
|
public void SetImplicitTypeCode(Reference<RowCursor> edit) {
|
||||||
edit.get().cellType = edit.get().scopeType.Immutable ? ImmutableTypedTuple :
|
edit.get().cellType = edit.get().scopeType.Immutable ? ImmutableTypedTuple :
|
||||||
TypedTuple;
|
TypedTuple;
|
||||||
edit.get().cellTypeArgs = edit.get().scopeTypeArgs.clone();
|
edit.get().cellTypeArgs = edit.get().scopeTypeArgs.clone();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result WriteScope(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
public Result WriteScope(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||||
TypeArgumentList typeArgs, OutObject<RowCursor> value) {
|
TypeArgumentList typeArgs, Out<RowCursor> value) {
|
||||||
return WriteScope(b, edit, typeArgs, value, UpdateOptions.Upsert);
|
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
|
//ORIGINAL LINE: public override Result WriteScope(ref RowBuffer b, ref RowCursor edit, TypeArgumentList
|
||||||
// typeArgs, out RowCursor value, UpdateOptions options = UpdateOptions.Upsert)
|
// typeArgs, out RowCursor value, UpdateOptions options = UpdateOptions.Upsert)
|
||||||
@Override
|
@Override
|
||||||
public Result WriteScope(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
public Result WriteScope(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||||
TypeArgumentList typeArgs, OutObject<RowCursor> value, UpdateOptions options) {
|
TypeArgumentList typeArgs, Out<RowCursor> value, UpdateOptions options) {
|
||||||
Result result = PrepareSparseWrite(b, edit, new TypeArgument(this, typeArgs.clone()), options);
|
Result result = PrepareSparseWrite(b, edit, new TypeArgument(this, typeArgs.clone()), options);
|
||||||
if (result != Result.Success) {
|
if (result != Result.Success) {
|
||||||
value.set(null);
|
value.set(null);
|
||||||
@@ -90,7 +91,7 @@ public final class LayoutTypedMap extends LayoutUniqueScope {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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);
|
checkState(value.getCount() == 2);
|
||||||
row.get().WriteSparseTypeCode(offset, this.LayoutCode);
|
row.get().WriteSparseTypeCode(offset, this.LayoutCode);
|
||||||
int lenInBytes = (com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutCode.SIZE / Byte.SIZE);
|
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;
|
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.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.Result;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
||||||
@@ -30,32 +31,32 @@ public final class LayoutTypedSet extends LayoutUniqueScope {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TypeArgument FieldType(RefObject<RowCursor> scope) {
|
public TypeArgument FieldType(Reference<RowCursor> scope) {
|
||||||
return scope.get().scopeTypeArgs.get(0).clone();
|
return scope.get().scopeTypeArgs.get(0).clone();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean HasImplicitTypeCode(RefObject<RowCursor> edit) {
|
public boolean HasImplicitTypeCode(Reference<RowCursor> edit) {
|
||||||
checkState(edit.get().index >= 0);
|
checkState(edit.get().index >= 0);
|
||||||
checkState(edit.get().scopeTypeArgs.getCount() == 1);
|
checkState(edit.get().scopeTypeArgs.getCount() == 1);
|
||||||
return !LayoutCodeTraits.AlwaysRequiresTypeCode(edit.get().scopeTypeArgs.get(0).getType().LayoutCode);
|
return !LayoutCodeTraits.AlwaysRequiresTypeCode(edit.get().scopeTypeArgs.get(0).getType().LayoutCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TypeArgumentList ReadTypeArgumentList(RefObject<RowBuffer> row, int offset,
|
public TypeArgumentList ReadTypeArgumentList(Reference<RowBuffer> row, int offset,
|
||||||
OutObject<Integer> lenInBytes) {
|
Out<Integer> lenInBytes) {
|
||||||
return new TypeArgumentList(new TypeArgument[] { ReadTypeArgument(row, offset, lenInBytes) });
|
return new TypeArgumentList(new TypeArgument[] { ReadTypeArgument(row, offset, lenInBytes) });
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void SetImplicitTypeCode(RefObject<RowCursor> edit) {
|
public void SetImplicitTypeCode(Reference<RowCursor> edit) {
|
||||||
edit.get().cellType = edit.get().scopeTypeArgs.get(0).getType();
|
edit.get().cellType = edit.get().scopeTypeArgs.get(0).getType();
|
||||||
edit.get().cellTypeArgs = edit.get().scopeTypeArgs.get(0).getTypeArgs().clone();
|
edit.get().cellTypeArgs = edit.get().scopeTypeArgs.get(0).getTypeArgs().clone();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result WriteScope(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
public Result WriteScope(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||||
TypeArgumentList typeArgs, OutObject<RowCursor> value) {
|
TypeArgumentList typeArgs, Out<RowCursor> value) {
|
||||||
return WriteScope(b, edit, typeArgs, value, UpdateOptions.Upsert);
|
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
|
//ORIGINAL LINE: public override Result WriteScope(ref RowBuffer b, ref RowCursor edit, TypeArgumentList
|
||||||
// typeArgs, out RowCursor value, UpdateOptions options = UpdateOptions.Upsert)
|
// typeArgs, out RowCursor value, UpdateOptions options = UpdateOptions.Upsert)
|
||||||
@Override
|
@Override
|
||||||
public Result WriteScope(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
public Result WriteScope(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||||
TypeArgumentList typeArgs, OutObject<RowCursor> value, UpdateOptions options) {
|
TypeArgumentList typeArgs, Out<RowCursor> value, UpdateOptions options) {
|
||||||
Result result = PrepareSparseWrite(b, edit, new TypeArgument(this, typeArgs.clone()), options);
|
Result result = PrepareSparseWrite(b, edit, new TypeArgument(this, typeArgs.clone()), options);
|
||||||
if (result != Result.Success) {
|
if (result != Result.Success) {
|
||||||
value.set(null);
|
value.set(null);
|
||||||
@@ -76,7 +77,7 @@ public final class LayoutTypedSet extends LayoutUniqueScope {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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);
|
checkArgument(value.getCount() == 1);
|
||||||
row.get().WriteSparseTypeCode(offset, this.LayoutCode);
|
row.get().WriteSparseTypeCode(offset, this.LayoutCode);
|
||||||
int lenInBytes = (com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutCode.SIZE / Byte.SIZE);
|
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;
|
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.RefObject;
|
import com.azure.data.cosmos.core.Reference;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.Result;
|
import com.azure.data.cosmos.serialization.hybridrow.Result;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
||||||
@@ -37,20 +37,20 @@ public final class LayoutTypedTuple extends LayoutIndexedScope {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean HasImplicitTypeCode(RefObject<RowCursor> edit) {
|
public boolean HasImplicitTypeCode(Reference<RowCursor> edit) {
|
||||||
checkArgument(edit.get().index >= 0);
|
checkArgument(edit.get().index >= 0);
|
||||||
checkArgument(edit.get().scopeTypeArgs.getCount() > edit.get().index);
|
checkArgument(edit.get().scopeTypeArgs.getCount() > edit.get().index);
|
||||||
return !LayoutCodeTraits.AlwaysRequiresTypeCode(edit.get().scopeTypeArgs.get(edit.get().index).getType().LayoutCode);
|
return !LayoutCodeTraits.AlwaysRequiresTypeCode(edit.get().scopeTypeArgs.get(edit.get().index).getType().LayoutCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TypeArgumentList ReadTypeArgumentList(RefObject<RowBuffer> row, int offset,
|
public TypeArgumentList ReadTypeArgumentList(Reference<RowBuffer> row, int offset,
|
||||||
OutObject<Integer> lenInBytes) {
|
Out<Integer> lenInBytes) {
|
||||||
int numTypeArgs = row.get().intValue().Read7BitEncodedUInt(offset, lenInBytes);
|
int numTypeArgs = row.get().intValue().Read7BitEncodedUInt(offset, lenInBytes);
|
||||||
TypeArgument[] retval = new TypeArgument[numTypeArgs];
|
TypeArgument[] retval = new TypeArgument[numTypeArgs];
|
||||||
for (int i = 0; i < numTypeArgs; i++) {
|
for (int i = 0; i < numTypeArgs; i++) {
|
||||||
int itemLenInBytes;
|
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);
|
retval[i] = LayoutType.ReadTypeArgument(row, offset + lenInBytes.get(), tempOut_itemLenInBytes);
|
||||||
itemLenInBytes = tempOut_itemLenInBytes.get();
|
itemLenInBytes = tempOut_itemLenInBytes.get();
|
||||||
lenInBytes.set(lenInBytes.get() + itemLenInBytes);
|
lenInBytes.set(lenInBytes.get() + itemLenInBytes);
|
||||||
@@ -60,14 +60,14 @@ public final class LayoutTypedTuple extends LayoutIndexedScope {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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().cellType = edit.get().scopeTypeArgs.get(edit.get().index).getType();
|
||||||
edit.get().cellTypeArgs = edit.get().scopeTypeArgs.get(edit.get().index).getTypeArgs().clone();
|
edit.get().cellTypeArgs = edit.get().scopeTypeArgs.get(edit.get().index).getTypeArgs().clone();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result WriteScope(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
public Result WriteScope(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||||
TypeArgumentList typeArgs, OutObject<RowCursor> value) {
|
TypeArgumentList typeArgs, Out<RowCursor> value) {
|
||||||
return WriteScope(b, edit, typeArgs, value, UpdateOptions.Upsert);
|
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
|
//ORIGINAL LINE: public override Result WriteScope(ref RowBuffer b, ref RowCursor edit, TypeArgumentList
|
||||||
// typeArgs, out RowCursor value, UpdateOptions options = UpdateOptions.Upsert)
|
// typeArgs, out RowCursor value, UpdateOptions options = UpdateOptions.Upsert)
|
||||||
@Override
|
@Override
|
||||||
public Result WriteScope(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
public Result WriteScope(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||||
TypeArgumentList typeArgs, OutObject<RowCursor> value, UpdateOptions options) {
|
TypeArgumentList typeArgs, Out<RowCursor> value, UpdateOptions options) {
|
||||||
Result result = LayoutType.PrepareSparseWrite(b, edit, new TypeArgument(this, typeArgs.clone()), options);
|
Result result = LayoutType.PrepareSparseWrite(b, edit, new TypeArgument(this, typeArgs.clone()), options);
|
||||||
if (result != Result.Success) {
|
if (result != Result.Success) {
|
||||||
value.set(null);
|
value.set(null);
|
||||||
@@ -88,7 +88,7 @@ public final class LayoutTypedTuple extends LayoutIndexedScope {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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().WriteSparseTypeCode(offset, this.LayoutCode);
|
||||||
int lenInBytes = (com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutCode.SIZE / Byte.SIZE);
|
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:
|
//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;
|
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.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.Result;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
||||||
@@ -28,16 +29,16 @@ public final class LayoutUDT extends LayoutPropertyScope {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TypeArgumentList ReadTypeArgumentList(RefObject<RowBuffer> row, int offset,
|
public TypeArgumentList ReadTypeArgumentList(Reference<RowBuffer> row, int offset,
|
||||||
OutObject<Integer> lenInBytes) {
|
Out<Integer> lenInBytes) {
|
||||||
SchemaId schemaId = row.get().ReadSchemaId(offset).clone();
|
SchemaId schemaId = row.get().ReadSchemaId(offset).clone();
|
||||||
lenInBytes.set(SchemaId.Size);
|
lenInBytes.set(SchemaId.Size);
|
||||||
return new TypeArgumentList(schemaId.clone());
|
return new TypeArgumentList(schemaId.clone());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result WriteScope(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
public Result WriteScope(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||||
TypeArgumentList typeArgs, OutObject<RowCursor> value) {
|
TypeArgumentList typeArgs, Out<RowCursor> value) {
|
||||||
return WriteScope(b, edit, typeArgs, value, UpdateOptions.Upsert);
|
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
|
//ORIGINAL LINE: public override Result WriteScope(ref RowBuffer b, ref RowCursor edit, TypeArgumentList
|
||||||
// typeArgs, out RowCursor value, UpdateOptions options = UpdateOptions.Upsert)
|
// typeArgs, out RowCursor value, UpdateOptions options = UpdateOptions.Upsert)
|
||||||
@Override
|
@Override
|
||||||
public Result WriteScope(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
public Result WriteScope(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||||
TypeArgumentList typeArgs, OutObject<RowCursor> value, UpdateOptions options) {
|
TypeArgumentList typeArgs, Out<RowCursor> value, UpdateOptions options) {
|
||||||
Layout udt = b.get().getResolver().Resolve(typeArgs.getSchemaId().clone());
|
Layout udt = b.get().getResolver().Resolve(typeArgs.getSchemaId().clone());
|
||||||
Result result = PrepareSparseWrite(b, edit, new TypeArgument(this, typeArgs.clone()), options);
|
Result result = PrepareSparseWrite(b, edit, new TypeArgument(this, typeArgs.clone()), options);
|
||||||
if (result != Result.Success) {
|
if (result != Result.Success) {
|
||||||
@@ -59,7 +60,7 @@ public final class LayoutUDT extends LayoutPropertyScope {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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().WriteSparseTypeCode(offset, this.LayoutCode);
|
||||||
row.get().WriteSchemaId(offset + (com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutCode.SIZE / Byte.SIZE), value.getSchemaId().clone());
|
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;
|
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;
|
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.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.Result;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
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
|
//ORIGINAL LINE: public override Result ReadFixed(ref RowBuffer b, ref RowCursor scope, LayoutColumn col, out
|
||||||
// ushort value)
|
// ushort value)
|
||||||
@Override
|
@Override
|
||||||
public Result ReadFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
public Result ReadFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col,
|
||||||
OutObject<Short> value) {
|
Out<Short> value) {
|
||||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||||
if (!b.get().ReadBit(scope.get().start, col.getNullBit().clone())) {
|
if (!b.get().ReadBit(scope.get().start, col.getNullBit().clone())) {
|
||||||
value.set(0);
|
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:
|
//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)
|
//ORIGINAL LINE: public override Result ReadSparse(ref RowBuffer b, ref RowCursor edit, out ushort value)
|
||||||
@Override
|
@Override
|
||||||
public Result ReadSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
public Result ReadSparse(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||||
OutObject<Short> value) {
|
Out<Short> value) {
|
||||||
Result result = PrepareSparseRead(b, edit, this.LayoutCode);
|
Result result = PrepareSparseRead(b, edit, this.LayoutCode);
|
||||||
if (result != Result.Success) {
|
if (result != Result.Success) {
|
||||||
value.set(0);
|
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
|
//ORIGINAL LINE: public override Result WriteFixed(ref RowBuffer b, ref RowCursor scope, LayoutColumn col, ushort
|
||||||
// value)
|
// value)
|
||||||
@Override
|
@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) {
|
short value) {
|
||||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||||
if (scope.get().immutable) {
|
if (scope.get().immutable) {
|
||||||
@@ -81,7 +82,7 @@ public final class LayoutUInt16 extends LayoutType<Short> {
|
|||||||
// UpdateOptions options = UpdateOptions.Upsert)
|
// UpdateOptions options = UpdateOptions.Upsert)
|
||||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||||
@Override
|
@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) {
|
UpdateOptions options) {
|
||||||
Result result = PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options);
|
Result result = PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options);
|
||||||
if (result != Result.Success) {
|
if (result != Result.Success) {
|
||||||
@@ -93,7 +94,7 @@ public final class LayoutUInt16 extends LayoutType<Short> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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);
|
return WriteSparse(b, edit, value, UpdateOptions.Upsert);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4,8 +4,9 @@
|
|||||||
|
|
||||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
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.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.Result;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
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
|
//ORIGINAL LINE: public override Result ReadFixed(ref RowBuffer b, ref RowCursor scope, LayoutColumn col, out
|
||||||
// uint value)
|
// uint value)
|
||||||
@Override
|
@Override
|
||||||
public Result ReadFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
public Result ReadFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col,
|
||||||
OutObject<Integer> value) {
|
Out<Integer> value) {
|
||||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||||
if (!b.get().ReadBit(scope.get().start, col.getNullBit().clone())) {
|
if (!b.get().ReadBit(scope.get().start, col.getNullBit().clone())) {
|
||||||
value.set(0);
|
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:
|
//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)
|
//ORIGINAL LINE: public override Result ReadSparse(ref RowBuffer b, ref RowCursor edit, out uint value)
|
||||||
@Override
|
@Override
|
||||||
public Result ReadSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
public Result ReadSparse(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||||
OutObject<Integer> value) {
|
Out<Integer> value) {
|
||||||
Result result = PrepareSparseRead(b, edit, this.LayoutCode);
|
Result result = PrepareSparseRead(b, edit, this.LayoutCode);
|
||||||
if (result != Result.Success) {
|
if (result != Result.Success) {
|
||||||
value.set(0);
|
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
|
//ORIGINAL LINE: public override Result WriteFixed(ref RowBuffer b, ref RowCursor scope, LayoutColumn col, uint
|
||||||
// value)
|
// value)
|
||||||
@Override
|
@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) {
|
int value) {
|
||||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||||
if (scope.get().immutable) {
|
if (scope.get().immutable) {
|
||||||
@@ -81,7 +82,7 @@ public final class LayoutUInt32 extends LayoutType<Integer> {
|
|||||||
// UpdateOptions options = UpdateOptions.Upsert)
|
// UpdateOptions options = UpdateOptions.Upsert)
|
||||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||||
@Override
|
@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) {
|
UpdateOptions options) {
|
||||||
Result result = PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options);
|
Result result = PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options);
|
||||||
if (result != Result.Success) {
|
if (result != Result.Success) {
|
||||||
@@ -93,7 +94,7 @@ public final class LayoutUInt32 extends LayoutType<Integer> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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);
|
return WriteSparse(b, edit, value, UpdateOptions.Upsert);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4,8 +4,9 @@
|
|||||||
|
|
||||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
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.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.Result;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
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
|
//ORIGINAL LINE: public override Result ReadFixed(ref RowBuffer b, ref RowCursor scope, LayoutColumn col, out
|
||||||
// ulong value)
|
// ulong value)
|
||||||
@Override
|
@Override
|
||||||
public Result ReadFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
public Result ReadFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col,
|
||||||
OutObject<Long> value) {
|
Out<Long> value) {
|
||||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||||
if (!b.get().ReadBit(scope.get().start, col.getNullBit().clone())) {
|
if (!b.get().ReadBit(scope.get().start, col.getNullBit().clone())) {
|
||||||
value.set(0);
|
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:
|
//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)
|
//ORIGINAL LINE: public override Result ReadSparse(ref RowBuffer b, ref RowCursor edit, out ulong value)
|
||||||
@Override
|
@Override
|
||||||
public Result ReadSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
public Result ReadSparse(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||||
OutObject<Long> value) {
|
Out<Long> value) {
|
||||||
Result result = PrepareSparseRead(b, edit, this.LayoutCode);
|
Result result = PrepareSparseRead(b, edit, this.LayoutCode);
|
||||||
if (result != Result.Success) {
|
if (result != Result.Success) {
|
||||||
value.set(0);
|
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
|
//ORIGINAL LINE: public override Result WriteFixed(ref RowBuffer b, ref RowCursor scope, LayoutColumn col, ulong
|
||||||
// value)
|
// value)
|
||||||
@Override
|
@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) {
|
long value) {
|
||||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||||
if (scope.get().immutable) {
|
if (scope.get().immutable) {
|
||||||
@@ -81,7 +82,7 @@ public final class LayoutUInt64 extends LayoutType<Long> {
|
|||||||
// UpdateOptions options = UpdateOptions.Upsert)
|
// UpdateOptions options = UpdateOptions.Upsert)
|
||||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||||
@Override
|
@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) {
|
UpdateOptions options) {
|
||||||
Result result = PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options);
|
Result result = PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options);
|
||||||
if (result != Result.Success) {
|
if (result != Result.Success) {
|
||||||
@@ -93,7 +94,7 @@ public final class LayoutUInt64 extends LayoutType<Long> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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);
|
return WriteSparse(b, edit, value, UpdateOptions.Upsert);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4,8 +4,9 @@
|
|||||||
|
|
||||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
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.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.Result;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
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
|
//ORIGINAL LINE: public override Result ReadFixed(ref RowBuffer b, ref RowCursor scope, LayoutColumn col, out
|
||||||
// byte value)
|
// byte value)
|
||||||
@Override
|
@Override
|
||||||
public Result ReadFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
public Result ReadFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col,
|
||||||
OutObject<Byte> value) {
|
Out<Byte> value) {
|
||||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||||
if (!b.get().ReadBit(scope.get().start, col.getNullBit().clone())) {
|
if (!b.get().ReadBit(scope.get().start, col.getNullBit().clone())) {
|
||||||
value.set(0);
|
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:
|
//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)
|
//ORIGINAL LINE: public override Result ReadSparse(ref RowBuffer b, ref RowCursor edit, out byte value)
|
||||||
@Override
|
@Override
|
||||||
public Result ReadSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
public Result ReadSparse(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||||
OutObject<Byte> value) {
|
Out<Byte> value) {
|
||||||
Result result = PrepareSparseRead(b, edit, this.LayoutCode);
|
Result result = PrepareSparseRead(b, edit, this.LayoutCode);
|
||||||
if (result != Result.Success) {
|
if (result != Result.Success) {
|
||||||
value.set(0);
|
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
|
//ORIGINAL LINE: public override Result WriteFixed(ref RowBuffer b, ref RowCursor scope, LayoutColumn col, byte
|
||||||
// value)
|
// value)
|
||||||
@Override
|
@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) {
|
byte value) {
|
||||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||||
if (scope.get().immutable) {
|
if (scope.get().immutable) {
|
||||||
@@ -81,7 +82,7 @@ public final class LayoutUInt8 extends LayoutType<Byte> {
|
|||||||
// UpdateOptions options = UpdateOptions.Upsert)
|
// UpdateOptions options = UpdateOptions.Upsert)
|
||||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||||
@Override
|
@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) {
|
UpdateOptions options) {
|
||||||
Result result = PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options);
|
Result result = PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options);
|
||||||
if (result != Result.Success) {
|
if (result != Result.Success) {
|
||||||
@@ -93,7 +94,7 @@ public final class LayoutUInt8 extends LayoutType<Byte> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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);
|
return WriteSparse(b, edit, value, UpdateOptions.Upsert);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4,8 +4,9 @@
|
|||||||
|
|
||||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
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.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.Result;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
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);
|
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.
|
* Search for a matching field within a unique index.
|
||||||
@@ -35,8 +36,8 @@ public abstract class LayoutUniqueScope extends LayoutIndexedScope {
|
|||||||
* <p>
|
* <p>
|
||||||
* The pattern field is delete whether the find succeeds or fails.
|
* The pattern field is delete whether the find succeeds or fails.
|
||||||
*/
|
*/
|
||||||
public final Result Find(RefObject<RowBuffer> b, RefObject<RowCursor> scope,
|
public final Result Find(Reference<RowBuffer> b, Reference<RowCursor> scope,
|
||||||
RefObject<RowCursor> patternScope, OutObject<RowCursor> value) {
|
Reference<RowCursor> patternScope, Out<RowCursor> value) {
|
||||||
Result result = LayoutType.PrepareSparseMove(b, scope, this, this.FieldType(scope).clone(), patternScope, UpdateOptions.Update, value.clone());
|
Result result = LayoutType.PrepareSparseMove(b, scope, this, this.FieldType(scope).clone(), patternScope, UpdateOptions.Update, value.clone());
|
||||||
|
|
||||||
if (result != Result.Success) {
|
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:
|
//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
|
//ORIGINAL LINE: public Result MoveField(ref RowBuffer b, ref RowCursor destinationScope, ref RowCursor
|
||||||
// sourceEdit, UpdateOptions options = UpdateOptions.Upsert)
|
// sourceEdit, UpdateOptions options = UpdateOptions.Upsert)
|
||||||
public final Result MoveField(RefObject<RowBuffer> b, RefObject<RowCursor> destinationScope,
|
public final Result MoveField(Reference<RowBuffer> b, Reference<RowCursor> destinationScope,
|
||||||
RefObject<RowCursor> sourceEdit, UpdateOptions options) {
|
Reference<RowCursor> sourceEdit, UpdateOptions options) {
|
||||||
RowCursor dstEdit;
|
RowCursor dstEdit;
|
||||||
OutObject<RowCursor> tempOut_dstEdit =
|
Out<RowCursor> tempOut_dstEdit =
|
||||||
new OutObject<RowCursor>();
|
new Out<RowCursor>();
|
||||||
Result result = LayoutType.PrepareSparseMove(b, destinationScope, this,
|
Result result = LayoutType.PrepareSparseMove(b, destinationScope, this,
|
||||||
this.FieldType(destinationScope).clone(), sourceEdit, options, tempOut_dstEdit);
|
this.FieldType(destinationScope).clone(), sourceEdit, options, tempOut_dstEdit);
|
||||||
dstEdit = tempOut_dstEdit.get();
|
dstEdit = tempOut_dstEdit.get();
|
||||||
@@ -66,10 +67,10 @@ public abstract class LayoutUniqueScope extends LayoutIndexedScope {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Perform the move.
|
// Perform the move.
|
||||||
RefObject<RowCursor> tempRef_dstEdit =
|
Reference<RowCursor> tempReference_dstEdit =
|
||||||
new RefObject<RowCursor>(dstEdit);
|
new Reference<RowCursor>(dstEdit);
|
||||||
b.get().TypedCollectionMoveField(tempRef_dstEdit, sourceEdit, RowOptions.forValue(options));
|
b.get().TypedCollectionMoveField(tempReference_dstEdit, sourceEdit, RowOptions.forValue(options));
|
||||||
dstEdit = tempRef_dstEdit.get();
|
dstEdit = tempReference_dstEdit.get();
|
||||||
|
|
||||||
// TODO: it would be "better" if the destinationScope were updated to point to the
|
// TODO: it would be "better" if the destinationScope were updated to point to the
|
||||||
// highest item seen. Then we would avoid the maximum reparse.
|
// 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.
|
* The source field is delete whether the move succeeds or fails.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public final Result MoveField(RefObject<RowBuffer> b, RefObject<RowCursor> destinationScope,
|
public final Result MoveField(Reference<RowBuffer> b, Reference<RowCursor> destinationScope,
|
||||||
RefObject<RowCursor> sourceEdit) {
|
Reference<RowCursor> sourceEdit) {
|
||||||
return MoveField(b, destinationScope, sourceEdit, UpdateOptions.Upsert);
|
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
|
// TypeArgumentList typeArgs, TContext context, WriterFunc<TContext> func, UpdateOptions options = UpdateOptions
|
||||||
// .Upsert)
|
// .Upsert)
|
||||||
@Override
|
@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,
|
TypeArgumentList typeArgs, TContext context, WriterFunc<TContext> func,
|
||||||
UpdateOptions options) {
|
UpdateOptions options) {
|
||||||
RowCursor uniqueScope;
|
RowCursor uniqueScope;
|
||||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
|
// 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);
|
Result r = this.WriteScope(b, scope, typeArgs.clone(), out uniqueScope, options);
|
||||||
if (r != Result.Success) {
|
if (r != Result.Success) {
|
||||||
return r;
|
return r;
|
||||||
@@ -115,39 +116,39 @@ public abstract class LayoutUniqueScope extends LayoutIndexedScope {
|
|||||||
|
|
||||||
RowCursor childScope;
|
RowCursor childScope;
|
||||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
|
// 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);
|
uniqueScope.Clone(out childScope);
|
||||||
childScope.deferUniqueIndex = true;
|
childScope.deferUniqueIndex = true;
|
||||||
RefObject<RowCursor> tempRef_childScope =
|
Reference<RowCursor> tempReference_childScope =
|
||||||
new RefObject<RowCursor>(childScope);
|
new Reference<RowCursor>(childScope);
|
||||||
// TODO: C# TO JAVA CONVERTER: The following line could not be converted:
|
// 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;
|
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) {
|
if (r != Result.Success) {
|
||||||
this.DeleteScope(b, scope);
|
this.DeleteScope(b, scope);
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
uniqueScope.count = childScope.count;
|
uniqueScope.count = childScope.count;
|
||||||
RefObject<RowCursor> tempRef_uniqueScope =
|
Reference<RowCursor> tempReference_uniqueScope =
|
||||||
new RefObject<RowCursor>(uniqueScope);
|
new Reference<RowCursor>(uniqueScope);
|
||||||
r = b.get().TypedCollectionUniqueIndexRebuild(tempRef_uniqueScope);
|
r = b.get().TypedCollectionUniqueIndexRebuild(tempReference_uniqueScope);
|
||||||
uniqueScope = tempRef_uniqueScope.get();
|
uniqueScope = tempReference_uniqueScope.get();
|
||||||
if (r != Result.Success) {
|
if (r != Result.Success) {
|
||||||
this.DeleteScope(b, scope);
|
this.DeleteScope(b, scope);
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
RefObject<RowCursor> tempRef_childScope2 =
|
Reference<RowCursor> tempReference_childScope2 =
|
||||||
new RefObject<RowCursor>(childScope);
|
new Reference<RowCursor>(childScope);
|
||||||
RowCursorExtensions.Skip(scope.get().clone(), b,
|
RowCursorExtensions.Skip(scope.get().clone(), b,
|
||||||
tempRef_childScope2);
|
tempReference_childScope2);
|
||||||
childScope = tempRef_childScope2.get();
|
childScope = tempReference_childScope2.get();
|
||||||
return Result.Success;
|
return Result.Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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) {
|
TypeArgumentList typeArgs, TContext context, WriterFunc<TContext> func) {
|
||||||
return WriteScope(b, scope, typeArgs, context, func, UpdateOptions.Upsert);
|
return WriteScope(b, scope, typeArgs, context, func, UpdateOptions.Upsert);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,8 +4,9 @@
|
|||||||
|
|
||||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
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.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.Result;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
||||||
@@ -30,8 +31,8 @@ public final class LayoutUnixDateTime extends LayoutType<com.azure.data.cosmos.s
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result ReadFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
public Result ReadFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col,
|
||||||
OutObject<UnixDateTime> value) {
|
Out<UnixDateTime> value) {
|
||||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||||
if (!b.get().ReadBit(scope.get().start, col.getNullBit().clone())) {
|
if (!b.get().ReadBit(scope.get().start, col.getNullBit().clone())) {
|
||||||
value.set(null);
|
value.set(null);
|
||||||
@@ -43,8 +44,8 @@ public final class LayoutUnixDateTime extends LayoutType<com.azure.data.cosmos.s
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result ReadSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
public Result ReadSparse(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||||
OutObject<UnixDateTime> value) {
|
Out<UnixDateTime> value) {
|
||||||
Result result = PrepareSparseRead(b, edit, this.LayoutCode);
|
Result result = PrepareSparseRead(b, edit, this.LayoutCode);
|
||||||
if (result != Result.Success) {
|
if (result != Result.Success) {
|
||||||
value.set(null);
|
value.set(null);
|
||||||
@@ -56,7 +57,7 @@ public final class LayoutUnixDateTime extends LayoutType<com.azure.data.cosmos.s
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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) {
|
UnixDateTime value) {
|
||||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||||
if (scope.get().immutable) {
|
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,
|
//ORIGINAL LINE: public override Result WriteSparse(ref RowBuffer b, ref RowCursor edit, UnixDateTime value,
|
||||||
// UpdateOptions options = UpdateOptions.Upsert)
|
// UpdateOptions options = UpdateOptions.Upsert)
|
||||||
@Override
|
@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) {
|
, UpdateOptions options) {
|
||||||
Result result = PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options);
|
Result result = PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options);
|
||||||
if (result != Result.Success) {
|
if (result != Result.Success) {
|
||||||
@@ -84,7 +85,7 @@ public final class LayoutUnixDateTime extends LayoutType<com.azure.data.cosmos.s
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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);
|
return WriteSparse(b, edit, value, UpdateOptions.Upsert);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4,8 +4,9 @@
|
|||||||
|
|
||||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
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.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.Result;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
||||||
@@ -28,19 +29,19 @@ public final class LayoutUtf8 extends LayoutType<String> implements ILayoutUtf8S
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result ReadFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
public Result ReadFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col,
|
||||||
OutObject<String> value) {
|
Out<String> value) {
|
||||||
Utf8Span span;
|
Utf8Span span;
|
||||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
|
// 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);
|
Result r = this.ReadFixed(b, scope, col, out span);
|
||||||
value.set((r == Result.Success) ? span.toString() :)
|
value.set((r == Result.Success) ? span.toString() :)
|
||||||
default
|
default
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Result ReadFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
public Result ReadFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col,
|
||||||
OutObject<Utf8Span> value) {
|
Out<Utf8Span> value) {
|
||||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||||
checkArgument(col.getSize() >= 0);
|
checkArgument(col.getSize() >= 0);
|
||||||
if (!b.get().ReadBit(scope.get().start, col.getNullBit().clone())) {
|
if (!b.get().ReadBit(scope.get().start, col.getNullBit().clone())) {
|
||||||
@@ -53,18 +54,18 @@ public final class LayoutUtf8 extends LayoutType<String> implements ILayoutUtf8S
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result ReadSparse(RefObject<RowBuffer> b, RefObject<RowCursor> edit,
|
public Result ReadSparse(Reference<RowBuffer> b, Reference<RowCursor> edit,
|
||||||
OutObject<String> value) {
|
Out<String> value) {
|
||||||
Utf8Span span;
|
Utf8Span span;
|
||||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
|
// 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);
|
Result r = this.ReadSparse(b, edit, out span);
|
||||||
value.set((r == Result.Success) ? span.toString() :)
|
value.set((r == Result.Success) ? span.toString() :)
|
||||||
default
|
default
|
||||||
return r;
|
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);
|
Result result = LayoutType.PrepareSparseRead(b, edit, this.LayoutCode);
|
||||||
if (result != Result.Success) {
|
if (result != Result.Success) {
|
||||||
value.set(null);
|
value.set(null);
|
||||||
@@ -76,19 +77,19 @@ public final class LayoutUtf8 extends LayoutType<String> implements ILayoutUtf8S
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result ReadVariable(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col
|
public Result ReadVariable(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col
|
||||||
, OutObject<String> value) {
|
, Out<String> value) {
|
||||||
Utf8Span span;
|
Utf8Span span;
|
||||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
|
// 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);
|
Result r = this.ReadVariable(b, scope, col, out span);
|
||||||
value.set((r == Result.Success) ? span.toString() :)
|
value.set((r == Result.Success) ? span.toString() :)
|
||||||
default
|
default
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Result ReadVariable(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col
|
public Result ReadVariable(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col
|
||||||
, OutObject<Utf8Span> value) {
|
, Out<Utf8Span> value) {
|
||||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||||
if (!b.get().ReadBit(scope.get().start, col.getNullBit().clone())) {
|
if (!b.get().ReadBit(scope.get().start, col.getNullBit().clone())) {
|
||||||
value.set(null);
|
value.set(null);
|
||||||
@@ -102,13 +103,13 @@ public final class LayoutUtf8 extends LayoutType<String> implements ILayoutUtf8S
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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) {
|
String value) {
|
||||||
checkArgument(value != null);
|
checkArgument(value != null);
|
||||||
return this.WriteFixed(b, scope, col, Utf8Span.TranscodeUtf16(value));
|
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) {
|
Utf8Span value) {
|
||||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||||
checkArgument(col.getSize() >= 0);
|
checkArgument(col.getSize() >= 0);
|
||||||
@@ -123,7 +124,7 @@ public final class LayoutUtf8 extends LayoutType<String> implements ILayoutUtf8S
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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);
|
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,
|
//ORIGINAL LINE: public override Result WriteSparse(ref RowBuffer b, ref RowCursor edit, string value,
|
||||||
// UpdateOptions options = UpdateOptions.Upsert)
|
// UpdateOptions options = UpdateOptions.Upsert)
|
||||||
@Override
|
@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) {
|
UpdateOptions options) {
|
||||||
checkArgument(value != null);
|
checkArgument(value != null);
|
||||||
return this.WriteSparse(b, edit, Utf8Span.TranscodeUtf16(value), options);
|
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);
|
return WriteSparse(b, edit, value, UpdateOptions.Upsert);
|
||||||
}
|
}
|
||||||
|
|
||||||
//C# TO JAVA CONVERTER NOTE: Java does not support optional parameters. Overloaded method(s) are created above:
|
//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
|
//ORIGINAL LINE: public Result WriteSparse(ref RowBuffer b, ref RowCursor edit, Utf8Span value, UpdateOptions
|
||||||
// options = UpdateOptions.Upsert)
|
// 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) {
|
UpdateOptions options) {
|
||||||
Result result = LayoutType.PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options);
|
Result result = LayoutType.PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options);
|
||||||
if (result != Result.Success) {
|
if (result != Result.Success) {
|
||||||
@@ -157,13 +158,13 @@ public final class LayoutUtf8 extends LayoutType<String> implements ILayoutUtf8S
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result WriteVariable(RefObject<RowBuffer> b, RefObject<RowCursor> scope,
|
public Result WriteVariable(Reference<RowBuffer> b, Reference<RowCursor> scope,
|
||||||
LayoutColumn col, String value) {
|
LayoutColumn col, String value) {
|
||||||
checkArgument(value != null);
|
checkArgument(value != null);
|
||||||
return this.WriteVariable(b, scope, col, Utf8Span.TranscodeUtf16(value));
|
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) {
|
LayoutColumn col, Utf8Span value) {
|
||||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||||
if (scope.get().immutable) {
|
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,
|
int varOffset = b.get().ComputeVariableValueOffset(scope.get().layout, scope.get().start,
|
||||||
col.getOffset());
|
col.getOffset());
|
||||||
int shift;
|
int shift;
|
||||||
OutObject<Integer> tempOut_shift = new OutObject<Integer>();
|
Out<Integer> tempOut_shift = new Out<Integer>();
|
||||||
b.get().WriteVariableString(varOffset, value, exists, tempOut_shift);
|
b.get().WriteVariableString(varOffset, value, exists, tempOut_shift);
|
||||||
shift = tempOut_shift.get();
|
shift = tempOut_shift.get();
|
||||||
b.get().SetBit(scope.get().start, col.getNullBit().clone());
|
b.get().SetBit(scope.get().start, col.getNullBit().clone());
|
||||||
|
|||||||
@@ -4,8 +4,8 @@
|
|||||||
|
|
||||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
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.RefObject;
|
import com.azure.data.cosmos.core.Reference;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.Result;
|
import com.azure.data.cosmos.serialization.hybridrow.Result;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
||||||
@@ -33,15 +33,15 @@ public final class LayoutVarInt extends LayoutType<Long> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result ReadFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
public Result ReadFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col,
|
||||||
OutObject<Long> value) {
|
Out<Long> value) {
|
||||||
Contract.Fail("Not Implemented");
|
Contract.Fail("Not Implemented");
|
||||||
value.set(0);
|
value.set(0);
|
||||||
return Result.Failure;
|
return Result.Failure;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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);
|
Result result = LayoutType.PrepareSparseRead(b, edit, this.LayoutCode);
|
||||||
if (result != Result.Success) {
|
if (result != Result.Success) {
|
||||||
value.set(0);
|
value.set(0);
|
||||||
@@ -53,7 +53,7 @@ public final class LayoutVarInt extends LayoutType<Long> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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);
|
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||||
if (!b.get().ReadBit(scope.get().start, col.getNullBit().clone())) {
|
if (!b.get().ReadBit(scope.get().start, col.getNullBit().clone())) {
|
||||||
value.set(0);
|
value.set(0);
|
||||||
@@ -67,7 +67,7 @@ public final class LayoutVarInt extends LayoutType<Long> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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) {
|
long value) {
|
||||||
Contract.Fail("Not Implemented");
|
Contract.Fail("Not Implemented");
|
||||||
return Result.Failure;
|
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,
|
//ORIGINAL LINE: public override Result WriteSparse(ref RowBuffer b, ref RowCursor edit, long value,
|
||||||
// UpdateOptions options = UpdateOptions.Upsert)
|
// UpdateOptions options = UpdateOptions.Upsert)
|
||||||
@Override
|
@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) {
|
UpdateOptions options) {
|
||||||
Result result = LayoutType.PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options);
|
Result result = LayoutType.PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options);
|
||||||
if (result != Result.Success) {
|
if (result != Result.Success) {
|
||||||
@@ -89,12 +89,12 @@ public final class LayoutVarInt extends LayoutType<Long> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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);
|
return WriteSparse(b, edit, value, UpdateOptions.Upsert);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result WriteVariable(RefObject<RowBuffer> b, RefObject<RowCursor> scope,
|
public Result WriteVariable(Reference<RowBuffer> b, Reference<RowCursor> scope,
|
||||||
LayoutColumn col, long value) {
|
LayoutColumn col, long value) {
|
||||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||||
if (scope.get().immutable) {
|
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,
|
int varOffset = b.get().ComputeVariableValueOffset(scope.get().layout, scope.get().start,
|
||||||
col.getOffset());
|
col.getOffset());
|
||||||
int shift;
|
int shift;
|
||||||
OutObject<Integer> tempOut_shift = new OutObject<Integer>();
|
Out<Integer> tempOut_shift = new Out<Integer>();
|
||||||
b.get().WriteVariableInt(varOffset, value, exists, tempOut_shift);
|
b.get().WriteVariableInt(varOffset, value, exists, tempOut_shift);
|
||||||
shift = tempOut_shift.get();
|
shift = tempOut_shift.get();
|
||||||
b.get().SetBit(scope.get().start, col.getNullBit().clone());
|
b.get().SetBit(scope.get().start, col.getNullBit().clone());
|
||||||
|
|||||||
@@ -4,8 +4,9 @@
|
|||||||
|
|
||||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
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.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.Result;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
|
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
|
//ORIGINAL LINE: public override Result ReadFixed(ref RowBuffer b, ref RowCursor scope, LayoutColumn col, out
|
||||||
// ulong value)
|
// ulong value)
|
||||||
@Override
|
@Override
|
||||||
public Result ReadFixed(RefObject<RowBuffer> b, RefObject<RowCursor> scope, LayoutColumn col,
|
public Result ReadFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col,
|
||||||
OutObject<Long> value) {
|
Out<Long> value) {
|
||||||
Contract.Fail("Not Implemented");
|
Contract.Fail("Not Implemented");
|
||||||
value.set(0);
|
value.set(0);
|
||||||
return Result.Failure;
|
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:
|
//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)
|
//ORIGINAL LINE: public override Result ReadSparse(ref RowBuffer b, ref RowCursor edit, out ulong value)
|
||||||
@Override
|
@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);
|
Result result = PrepareSparseRead(b, edit, this.LayoutCode);
|
||||||
if (result != Result.Success) {
|
if (result != Result.Success) {
|
||||||
value.set(0);
|
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
|
//ORIGINAL LINE: public override Result ReadVariable(ref RowBuffer b, ref RowCursor scope, LayoutColumn col, out
|
||||||
// ulong value)
|
// ulong value)
|
||||||
@Override
|
@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);
|
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||||
if (!b.get().ReadBit(scope.get().start, col.getNullBit().clone())) {
|
if (!b.get().ReadBit(scope.get().start, col.getNullBit().clone())) {
|
||||||
value.set(0);
|
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
|
//ORIGINAL LINE: public override Result WriteFixed(ref RowBuffer b, ref RowCursor scope, LayoutColumn col, ulong
|
||||||
// value)
|
// value)
|
||||||
@Override
|
@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) {
|
long value) {
|
||||||
Contract.Fail("Not Implemented");
|
Contract.Fail("Not Implemented");
|
||||||
return Result.Failure;
|
return Result.Failure;
|
||||||
@@ -91,7 +92,7 @@ public final class LayoutVarUInt extends LayoutType<Long> {
|
|||||||
// UpdateOptions options = UpdateOptions.Upsert)
|
// UpdateOptions options = UpdateOptions.Upsert)
|
||||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||||
@Override
|
@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) {
|
UpdateOptions options) {
|
||||||
Result result = PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options);
|
Result result = PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options);
|
||||||
if (result != Result.Success) {
|
if (result != Result.Success) {
|
||||||
@@ -103,7 +104,7 @@ public final class LayoutVarUInt extends LayoutType<Long> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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);
|
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,
|
//ORIGINAL LINE: public override Result WriteVariable(ref RowBuffer b, ref RowCursor scope, LayoutColumn col,
|
||||||
// ulong value)
|
// ulong value)
|
||||||
@Override
|
@Override
|
||||||
public Result WriteVariable(RefObject<RowBuffer> b, RefObject<RowCursor> scope,
|
public Result WriteVariable(Reference<RowBuffer> b, Reference<RowCursor> scope,
|
||||||
LayoutColumn col, long value) {
|
LayoutColumn col, long value) {
|
||||||
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
checkArgument(scope.get().scopeType instanceof LayoutUDT);
|
||||||
if (scope.get().immutable) {
|
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,
|
int varOffset = b.get().ComputeVariableValueOffset(scope.get().layout, scope.get().start,
|
||||||
col.getOffset());
|
col.getOffset());
|
||||||
int shift;
|
int shift;
|
||||||
OutObject<Integer> tempOut_shift = new OutObject<Integer>();
|
Out<Integer> tempOut_shift = new Out<Integer>();
|
||||||
b.get().WriteVariableUInt(varOffset, value, exists, tempOut_shift);
|
b.get().WriteVariableUInt(varOffset, value, exists, tempOut_shift);
|
||||||
shift = tempOut_shift.get();
|
shift = tempOut_shift.get();
|
||||||
b.get().SetBit(scope.get().start, col.getNullBit().clone());
|
b.get().SetBit(scope.get().start, col.getNullBit().clone());
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
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.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
@@ -21,7 +21,7 @@ public final class StringTokenizer {
|
|||||||
private HashMap<Utf8String, StringToken> tokens;
|
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() {
|
public StringTokenizer() {
|
||||||
this.tokens = new HashMap<Utf8String, StringToken>(Map.ofEntries(Map.entry(Utf8String.Empty,
|
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:
|
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||||
//ORIGINAL LINE: public bool TryFindString(ulong token, out Utf8String path)
|
//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:
|
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||||
//ORIGINAL LINE: if (token >= (ulong)this.strings.Count)
|
//ORIGINAL LINE: if (token >= (ulong)this.strings.Count)
|
||||||
if (token >= (long)this.strings.size()) {
|
if (token >= (long)this.strings.size()) {
|
||||||
@@ -87,7 +87,7 @@ public final class StringTokenizer {
|
|||||||
* @param token If successful, the string's assigned token.
|
* @param token If successful, the string's assigned token.
|
||||||
* @return True if successful, false otherwise.
|
* @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) {
|
if (path.IsNull) {
|
||||||
token.set(null);
|
token.set(null);
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ public final class TypeArgument implements IEquatable<TypeArgument> {
|
|||||||
private TypeArgumentList typeArgs = new TypeArgumentList();
|
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.
|
* @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 type The type of the constraint.
|
||||||
* @param typeArgs For generic types the type parameters.
|
* @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.
|
* @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
|
//C# TO JAVA CONVERTER WARNING: Java does not allow user-defined value types. The behavior of this class may
|
||||||
// differ from the original:
|
// differ from the original:
|
||||||
@@ -157,7 +157,7 @@ public final class TypeArgumentList implements IEquatable<TypeArgumentList> {
|
|||||||
private TypeArgument[] list;
|
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.
|
* @param list The list to enumerate.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
package com.azure.data.cosmos.serialization.hybridrow.layouts;
|
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 {
|
public enum UpdateOptions {
|
||||||
None(0),
|
None(0),
|
||||||
@@ -31,8 +31,8 @@ public enum UpdateOptions {
|
|||||||
/**
|
/**
|
||||||
* Update an existing value or insert a new value, if no value exists.
|
* Update an existing value or insert a new value, if no value exists.
|
||||||
* <p>
|
* <p>
|
||||||
* If a value exists, then this operation becomes <see cref="Update" />, otherwise it becomes
|
* If a value exists, then this operation becomes {@link Update}, otherwise it becomes
|
||||||
* <see cref="Insert" />.
|
* {@link Insert}.
|
||||||
*/
|
*/
|
||||||
Upsert(3),
|
Upsert(3),
|
||||||
|
|
||||||
@@ -40,7 +40,7 @@ public enum UpdateOptions {
|
|||||||
* Insert a new value moving existing values to the right.
|
* Insert a new value moving existing values to the right.
|
||||||
* <p>
|
* <p>
|
||||||
* Within an array scope, inserts a new value immediately at the index moving all subsequent
|
* 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);
|
InsertAt(4);
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
package com.azure.data.cosmos.serialization.hybridrow.recordio;
|
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.HybridRowHeader;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.HybridRowVersion;
|
import com.azure.data.cosmos.serialization.hybridrow.HybridRowVersion;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.ISpanResizer;
|
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 RecordLayout = SystemSchema.LayoutResolver.Resolve(SystemSchema.RecordSchemaId);
|
||||||
public static final Layout SegmentLayout = SystemSchema.LayoutResolver.Resolve(SystemSchema.SegmentSchemaId);
|
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);
|
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,
|
//ORIGINAL LINE: public static Result FormatRecord(ReadOnlyMemory<byte> body, out RowBuffer row,
|
||||||
// ISpanResizer<byte> resizer = default)
|
// ISpanResizer<byte> resizer = default)
|
||||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
//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) {
|
ISpanResizer<Byte> resizer) {
|
||||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||||
//ORIGINAL LINE: resizer = resizer != null ? resizer : DefaultSpanResizer<byte>.Default;
|
//ORIGINAL LINE: resizer = resizer != null ? resizer : DefaultSpanResizer<byte>.Default;
|
||||||
@@ -37,7 +37,7 @@ public final class RecordIOFormatter {
|
|||||||
RecordSerializer.Write, row.clone());
|
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);
|
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>
|
//ORIGINAL LINE: public static Result FormatSegment(Segment segment, out RowBuffer row, ISpanResizer<byte>
|
||||||
// resizer = default)
|
// resizer = default)
|
||||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
//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:
|
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||||
//ORIGINAL LINE: resizer = resizer != null ? resizer : DefaultSpanResizer<byte>.Default;
|
//ORIGINAL LINE: resizer = resizer != null ? resizer : DefaultSpanResizer<byte>.Default;
|
||||||
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
|
//ORIGINAL LINE: private static Result FormatObject<T>(ISpanResizer<byte> resizer, int initialCapacity, Layout
|
||||||
// layout, T obj, RowWriter.WriterFunc<T> writer, out RowBuffer row)
|
// layout, T obj, RowWriter.WriterFunc<T> writer, out RowBuffer row)
|
||||||
private static <T> Result FormatObject(ISpanResizer<Byte> resizer, int initialCapacity, Layout layout, T obj,
|
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.set(new RowBuffer(initialCapacity, resizer));
|
||||||
row.get().InitLayout(HybridRowVersion.V1, layout, SystemSchema.LayoutResolver);
|
row.get().InitLayout(HybridRowVersion.V1, layout, SystemSchema.LayoutResolver);
|
||||||
Result r = RowWriter.WriteBuffer(row.clone(), obj, writer);
|
Result r = RowWriter.WriteBuffer(row.clone(), obj, writer);
|
||||||
|
|||||||
@@ -4,8 +4,9 @@
|
|||||||
|
|
||||||
package com.azure.data.cosmos.serialization.hybridrow.recordio;
|
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.core.RefObject;
|
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.HybridRowHeader;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.HybridRowVersion;
|
import com.azure.data.cosmos.serialization.hybridrow.HybridRowVersion;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.Result;
|
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.
|
* 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
|
* @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.
|
* 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
|
* 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.
|
* during parsing.
|
||||||
* <p>
|
* <p>
|
||||||
* >
|
* >
|
||||||
@@ -57,9 +58,9 @@ public final class RecordIOParser {
|
|||||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
//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
|
//ORIGINAL LINE: public Result Process(Memory<byte> buffer, out ProductionType type, out Memory<byte> record, out
|
||||||
// int need, out int consumed)
|
// int need, out int consumed)
|
||||||
public Result Process(Memory<Byte> buffer, OutObject<ProductionType> type,
|
public Result Process(Memory<Byte> buffer, Out<ProductionType> type,
|
||||||
OutObject<Memory<Byte>> record, OutObject<Integer> need,
|
Out<Memory<Byte>> record, Out<Integer> need,
|
||||||
OutObject<Integer> consumed) {
|
Out<Integer> consumed) {
|
||||||
Result r = Result.Failure;
|
Result r = Result.Failure;
|
||||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||||
//ORIGINAL LINE: Memory<byte> b = buffer;
|
//ORIGINAL LINE: Memory<byte> b = buffer;
|
||||||
@@ -82,17 +83,17 @@ public final class RecordIOParser {
|
|||||||
//ORIGINAL LINE: Span<byte> span = b.Span.Slice(0, minimalSegmentRowSize);
|
//ORIGINAL LINE: Span<byte> span = b.Span.Slice(0, minimalSegmentRowSize);
|
||||||
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);
|
RowBuffer row = new RowBuffer(span, HybridRowVersion.V1, SystemSchema.LayoutResolver);
|
||||||
RefObject<RowBuffer> tempRef_row =
|
Reference<RowBuffer> tempReference_row =
|
||||||
new RefObject<RowBuffer>(row);
|
new Reference<RowBuffer>(row);
|
||||||
RowReader reader = new RowReader(tempRef_row);
|
RowReader reader = new RowReader(tempReference_row);
|
||||||
row = tempRef_row.get();
|
row = tempReference_row.get();
|
||||||
RefObject<RowReader> tempRef_reader =
|
Reference<RowReader> tempReference_reader =
|
||||||
new RefObject<RowReader>(reader);
|
new Reference<RowReader>(reader);
|
||||||
OutObject<Segment> tempOut_segment =
|
Out<Segment> tempOut_segment =
|
||||||
new OutObject<Segment>();
|
new Out<Segment>();
|
||||||
r = SegmentSerializer.Read(tempRef_reader, tempOut_segment);
|
r = SegmentSerializer.Read(tempReference_reader, tempOut_segment);
|
||||||
this.segment = tempOut_segment.get();
|
this.segment = tempOut_segment.get();
|
||||||
reader = tempRef_reader.get();
|
reader = tempReference_reader.get();
|
||||||
if (r != Result.Success) {
|
if (r != Result.Success) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -113,17 +114,17 @@ public final class RecordIOParser {
|
|||||||
//ORIGINAL LINE: Span<byte> span = b.Span.Slice(0, this.segment.Length);
|
//ORIGINAL LINE: Span<byte> span = b.Span.Slice(0, this.segment.Length);
|
||||||
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);
|
RowBuffer row = new RowBuffer(span, HybridRowVersion.V1, SystemSchema.LayoutResolver);
|
||||||
RefObject<RowBuffer> tempRef_row2 =
|
Reference<RowBuffer> tempReference_row2 =
|
||||||
new RefObject<RowBuffer>(row);
|
new Reference<RowBuffer>(row);
|
||||||
RowReader reader = new RowReader(tempRef_row2);
|
RowReader reader = new RowReader(tempReference_row2);
|
||||||
row = tempRef_row2.get();
|
row = tempReference_row2.get();
|
||||||
RefObject<RowReader> tempRef_reader2 =
|
Reference<RowReader> tempReference_reader2 =
|
||||||
new RefObject<RowReader>(reader);
|
new Reference<RowReader>(reader);
|
||||||
OutObject<Segment> tempOut_segment2
|
Out<Segment> tempOut_segment2
|
||||||
= new OutObject<Segment>();
|
= new Out<Segment>();
|
||||||
r = SegmentSerializer.Read(tempRef_reader2, tempOut_segment2);
|
r = SegmentSerializer.Read(tempReference_reader2, tempOut_segment2);
|
||||||
this.segment = tempOut_segment2.get();
|
this.segment = tempOut_segment2.get();
|
||||||
reader = tempRef_reader2.get();
|
reader = tempReference_reader2.get();
|
||||||
if (r != Result.Success) {
|
if (r != Result.Success) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -146,7 +147,7 @@ public final class RecordIOParser {
|
|||||||
|
|
||||||
HybridRowHeader header;
|
HybridRowHeader header;
|
||||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword -
|
// 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:
|
// being modified:
|
||||||
MemoryMarshal.TryRead(b.Span, out header);
|
MemoryMarshal.TryRead(b.Span, out header);
|
||||||
if (header.Version != HybridRowVersion.V1) {
|
if (header.Version != HybridRowVersion.V1) {
|
||||||
@@ -182,15 +183,15 @@ public final class RecordIOParser {
|
|||||||
//ORIGINAL LINE: Span<byte> span = b.Span.Slice(0, minimalRecordRowSize);
|
//ORIGINAL LINE: Span<byte> span = b.Span.Slice(0, minimalRecordRowSize);
|
||||||
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);
|
RowBuffer row = new RowBuffer(span, HybridRowVersion.V1, SystemSchema.LayoutResolver);
|
||||||
RefObject<RowBuffer> tempRef_row3 =
|
Reference<RowBuffer> tempReference_row3 =
|
||||||
new RefObject<RowBuffer>(row);
|
new Reference<RowBuffer>(row);
|
||||||
RowReader reader = new RowReader(tempRef_row3);
|
RowReader reader = new RowReader(tempReference_row3);
|
||||||
row = tempRef_row3.get();
|
row = tempReference_row3.get();
|
||||||
RefObject<RowReader> tempRef_reader3 = new RefObject<RowReader>(reader);
|
Reference<RowReader> tempReference_reader3 = new Reference<RowReader>(reader);
|
||||||
OutObject<Record> tempOut_record = new OutObject<Record>();
|
Out<Record> tempOut_record = new Out<Record>();
|
||||||
r = RecordSerializer.Read(tempRef_reader3, tempOut_record);
|
r = RecordSerializer.Read(tempReference_reader3, tempOut_record);
|
||||||
this.record = tempOut_record.get();
|
this.record = tempOut_record.get();
|
||||||
reader = tempRef_reader3.get();
|
reader = tempReference_reader3.get();
|
||||||
if (r != Result.Success) {
|
if (r != Result.Success) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
package com.azure.data.cosmos.serialization.hybridrow.recordio;
|
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.MemorySpanResizer;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.Result;
|
import com.azure.data.cosmos.serialization.hybridrow.Result;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
||||||
@@ -33,7 +33,7 @@ public final class RecordIOStream {
|
|||||||
* @param stm The stream to read from.
|
* @param stm The stream to read from.
|
||||||
* @param visitRecord A (required) delegate that is called once for each record.
|
* @param visitRecord A (required) delegate that is called once for each record.
|
||||||
* <p>
|
* <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
|
* of the
|
||||||
* record body's row buffer.
|
* record body's row buffer.
|
||||||
* </p>
|
* </p>
|
||||||
@@ -45,7 +45,7 @@ public final class RecordIOStream {
|
|||||||
* over.
|
* over.
|
||||||
* </p>
|
* </p>
|
||||||
* <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.
|
* the segment header's row buffer.
|
||||||
* </p>
|
* </p>
|
||||||
* <p>If <paramref name="visitSegment" /> returns an error then the sequence is aborted.</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) {
|
while (avail.Length > 0) {
|
||||||
// Loop around processing available data until we don't have anymore
|
// Loop around processing available data until we don't have anymore
|
||||||
RecordIOParser.ProductionType prodType;
|
RecordIOParser.ProductionType prodType;
|
||||||
OutObject<RecordIOParser.ProductionType> tempOut_prodType = new OutObject<RecordIOParser.ProductionType>();
|
Out<RecordIOParser.ProductionType> tempOut_prodType = new Out<RecordIOParser.ProductionType>();
|
||||||
Memory<Byte> record;
|
Memory<Byte> record;
|
||||||
OutObject<Memory<Byte>> tempOut_record = new OutObject<Memory<Byte>>();
|
Out<Memory<Byte>> tempOut_record = new Out<Memory<Byte>>();
|
||||||
OutObject<Integer> tempOut_need = new OutObject<Integer>();
|
Out<Integer> tempOut_need = new Out<Integer>();
|
||||||
int consumed;
|
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:
|
//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
|
//ORIGINAL LINE: Result r = parser.Process(avail, out RecordIOParser.ProductionType prodType, out
|
||||||
// Memory<byte> record, out need, out int consumed);
|
// Memory<byte> record, out need, out int consumed);
|
||||||
@@ -207,7 +207,7 @@ public final class RecordIOStream {
|
|||||||
segment.clone(), index ->
|
segment.clone(), index ->
|
||||||
{
|
{
|
||||||
ReadOnlyMemory<Byte> buffer;
|
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();
|
buffer = tempOut_buffer.get();
|
||||||
return new ValueTask<(Result, ReadOnlyMemory < Byte >) > ((r,buffer))
|
return new ValueTask<(Result, ReadOnlyMemory < Byte >) > ((r,buffer))
|
||||||
}, resizer);
|
}, resizer);
|
||||||
@@ -250,7 +250,7 @@ public final class RecordIOStream {
|
|||||||
|
|
||||||
// Write a RecordIO stream.
|
// Write a RecordIO stream.
|
||||||
Memory<Byte> metadata;
|
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:
|
//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);
|
//ORIGINAL LINE: Result r = RecordIOStream.FormatSegment(segment, resizer, out Memory<byte> metadata);
|
||||||
Result r = RecordIOStream.FormatSegment(segment.clone(), resizer, tempOut_metadata);
|
Result r = RecordIOStream.FormatSegment(segment.clone(), resizer, tempOut_metadata);
|
||||||
@@ -277,7 +277,7 @@ public final class RecordIOStream {
|
|||||||
break;
|
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:
|
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||||
//ORIGINAL LINE: r = RecordIOStream.FormatRow(body, resizer, out metadata);
|
//ORIGINAL LINE: r = RecordIOStream.FormatRow(body, resizer, out metadata);
|
||||||
r = RecordIOStream.FormatRow(body, resizer, tempOut_metadata2);
|
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:
|
//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)
|
//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;
|
RowBuffer row;
|
||||||
OutObject<RowBuffer> tempOut_row = new OutObject<RowBuffer>();
|
Out<RowBuffer> tempOut_row = new Out<RowBuffer>();
|
||||||
Result r = RecordIOFormatter.FormatRecord(body, tempOut_row, resizer);
|
Result r = RecordIOFormatter.FormatRecord(body, tempOut_row, resizer);
|
||||||
row = tempOut_row.get();
|
row = tempOut_row.get();
|
||||||
if (r != Result.Success) {
|
if (r != Result.Success) {
|
||||||
@@ -337,10 +337,10 @@ public final class RecordIOStream {
|
|||||||
//ORIGINAL LINE: private static Result FormatSegment(Segment segment, MemorySpanResizer<byte> resizer, out
|
//ORIGINAL LINE: private static Result FormatSegment(Segment segment, MemorySpanResizer<byte> resizer, out
|
||||||
// Memory<byte> block)
|
// Memory<byte> block)
|
||||||
private static Result FormatSegment(Segment segment, MemorySpanResizer<Byte> resizer,
|
private static Result FormatSegment(Segment segment, MemorySpanResizer<Byte> resizer,
|
||||||
OutObject<Memory<Byte>> block) {
|
Out<Memory<Byte>> block) {
|
||||||
RowBuffer row;
|
RowBuffer row;
|
||||||
OutObject<RowBuffer> tempOut_row =
|
Out<RowBuffer> tempOut_row =
|
||||||
new OutObject<RowBuffer>();
|
new Out<RowBuffer>();
|
||||||
Result r = RecordIOFormatter.FormatSegment(segment.clone(), tempOut_row, resizer);
|
Result r = RecordIOFormatter.FormatSegment(segment.clone(), tempOut_row, resizer);
|
||||||
row = tempOut_row.get();
|
row = tempOut_row.get();
|
||||||
if (r != Result.Success) {
|
if (r != Result.Success) {
|
||||||
@@ -364,6 +364,6 @@ public final class RecordIOStream {
|
|||||||
*/
|
*/
|
||||||
@FunctionalInterface
|
@FunctionalInterface
|
||||||
public interface ProduceFunc {
|
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;
|
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.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.Result;
|
||||||
|
|
||||||
public final class RecordSerializer {
|
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);
|
obj.set(null);
|
||||||
while (reader.get().Read()) {
|
while (reader.get().Read()) {
|
||||||
Result r;
|
Result r;
|
||||||
@@ -17,7 +18,7 @@ public final class RecordSerializer {
|
|||||||
// TODO: use Path tokens here.
|
// TODO: use Path tokens here.
|
||||||
switch (reader.get().getPath().toString()) {
|
switch (reader.get().getPath().toString()) {
|
||||||
case "length":
|
case "length":
|
||||||
OutObject<Integer> tempOut_Length = new OutObject<Integer>();
|
Out<Integer> tempOut_Length = new Out<Integer>();
|
||||||
r = reader.get().ReadInt32(tempOut_Length);
|
r = reader.get().ReadInt32(tempOut_Length);
|
||||||
obj.get().argValue.Length = tempOut_Length.get();
|
obj.get().argValue.Length = tempOut_Length.get();
|
||||||
if (r != Result.Success) {
|
if (r != Result.Success) {
|
||||||
@@ -26,7 +27,7 @@ public final class RecordSerializer {
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
case "crc32":
|
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:
|
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||||
//ORIGINAL LINE: r = reader.ReadUInt32(out obj.Crc32);
|
//ORIGINAL LINE: r = reader.ReadUInt32(out obj.Crc32);
|
||||||
r = reader.get().ReadUInt32(tempOut_Crc32);
|
r = reader.get().ReadUInt32(tempOut_Crc32);
|
||||||
@@ -42,7 +43,7 @@ public final class RecordSerializer {
|
|||||||
return Result.Success;
|
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;
|
Result r;
|
||||||
r = writer.get().WriteInt32("length", obj.Length);
|
r = writer.get().WriteInt32("length", obj.Length);
|
||||||
if (r != Result.Success) {
|
if (r != Result.Success) {
|
||||||
|
|||||||
@@ -4,8 +4,8 @@
|
|||||||
|
|
||||||
package com.azure.data.cosmos.serialization.hybridrow.recordio;
|
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.core.RefObject;
|
import com.azure.data.cosmos.core.Reference;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.HybridRowVersion;
|
import com.azure.data.cosmos.serialization.hybridrow.HybridRowVersion;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.Result;
|
import com.azure.data.cosmos.serialization.hybridrow.Result;
|
||||||
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
|
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 {
|
public final class SegmentSerializer {
|
||||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
//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)
|
//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);
|
RowBuffer row = new RowBuffer(span, HybridRowVersion.V1, resolver);
|
||||||
RefObject<RowBuffer> tempRef_row =
|
Reference<RowBuffer> tempReference_row =
|
||||||
new RefObject<RowBuffer>(row);
|
new Reference<RowBuffer>(row);
|
||||||
RowReader reader = new RowReader(tempRef_row);
|
RowReader reader = new RowReader(tempReference_row);
|
||||||
row = tempRef_row.get();
|
row = tempReference_row.get();
|
||||||
RefObject<RowReader> tempRef_reader =
|
Reference<RowReader> tempReference_reader =
|
||||||
new RefObject<RowReader>(reader);
|
new Reference<RowReader>(reader);
|
||||||
Result tempVar = SegmentSerializer.Read(tempRef_reader, obj.clone());
|
Result tempVar = SegmentSerializer.Read(tempReference_reader, obj.clone());
|
||||||
reader = tempRef_reader.get();
|
reader = tempReference_reader.get();
|
||||||
return tempVar;
|
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);
|
obj.set(null);
|
||||||
while (reader.get().Read()) {
|
while (reader.get().Read()) {
|
||||||
Result r;
|
Result r;
|
||||||
@@ -35,7 +35,7 @@ public final class SegmentSerializer {
|
|||||||
// TODO: use Path tokens here.
|
// TODO: use Path tokens here.
|
||||||
switch (reader.get().getPath().toString()) {
|
switch (reader.get().getPath().toString()) {
|
||||||
case "length":
|
case "length":
|
||||||
OutObject<Integer> tempOut_Length = new OutObject<Integer>();
|
Out<Integer> tempOut_Length = new Out<Integer>();
|
||||||
r = reader.get().ReadInt32(tempOut_Length);
|
r = reader.get().ReadInt32(tempOut_Length);
|
||||||
obj.get().argValue.Length = tempOut_Length.get();
|
obj.get().argValue.Length = tempOut_Length.get();
|
||||||
if (r != Result.Success) {
|
if (r != Result.Success) {
|
||||||
@@ -50,7 +50,7 @@ public final class SegmentSerializer {
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
case "comment":
|
case "comment":
|
||||||
OutObject<String> tempOut_Comment = new OutObject<String>();
|
Out<String> tempOut_Comment = new Out<String>();
|
||||||
r = reader.get().ReadString(tempOut_Comment);
|
r = reader.get().ReadString(tempOut_Comment);
|
||||||
obj.get().argValue.Comment = tempOut_Comment.get();
|
obj.get().argValue.Comment = tempOut_Comment.get();
|
||||||
if (r != Result.Success) {
|
if (r != Result.Success) {
|
||||||
@@ -59,7 +59,7 @@ public final class SegmentSerializer {
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
case "sdl":
|
case "sdl":
|
||||||
OutObject<String> tempOut_SDL = new OutObject<String>();
|
Out<String> tempOut_SDL = new Out<String>();
|
||||||
r = reader.get().ReadString(tempOut_SDL);
|
r = reader.get().ReadString(tempOut_SDL);
|
||||||
obj.get().argValue.SDL = tempOut_SDL.get();
|
obj.get().argValue.SDL = tempOut_SDL.get();
|
||||||
if (r != Result.Success) {
|
if (r != Result.Success) {
|
||||||
@@ -73,7 +73,7 @@ public final class SegmentSerializer {
|
|||||||
return Result.Success;
|
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;
|
Result r;
|
||||||
if (obj.Comment != null) {
|
if (obj.Comment != null) {
|
||||||
r = writer.get().WriteString("comment", obj.Comment);
|
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.
|
* Array properties represent an unbounded set of zero or more items.
|
||||||
* <p>
|
* <p>
|
||||||
* Arrays may be typed or untyped. Within typed arrays, all items MUST be the same type. The
|
* 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
|
* type of items is specified via {@link Items}. Typed arrays may be stored more efficiently
|
||||||
* than untyped arrays. When <see cref="Items" /> is unspecified, the array is untyped and its items
|
* than untyped arrays. When {@link Items} is unspecified, the array is untyped and its items
|
||||||
* may be heterogeneous.
|
* may be heterogeneous.
|
||||||
*/
|
*/
|
||||||
public class ArrayPropertyType extends ScopePropertyType {
|
public class ArrayPropertyType extends ScopePropertyType {
|
||||||
|
|||||||
@@ -10,10 +10,10 @@ package com.azure.data.cosmos.serialization.hybridrow.schemas;
|
|||||||
* <p>
|
* <p>
|
||||||
* <p>
|
* <p>
|
||||||
* Maps are typed or untyped. Within typed maps, all key MUST be the same type, and all
|
* 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" />
|
* values MUST be the same type. The type of both key and values is specified via {@link Keys}
|
||||||
* and <see cref="Values" /> respectively. Typed maps may be stored more efficiently than untyped
|
* and {@link Values} respectively. Typed maps may be stored more efficiently than untyped
|
||||||
* maps. When <see cref="Keys" /> or <see cref="Values" /> is unspecified or marked
|
* maps. When {@link Keys} or {@link Values} is unspecified or marked
|
||||||
* <see cref="TypeKind.Any" />, the map is untyped and its key and/or values may be heterogeneous.
|
* {@link TypeKind.Any}, the map is untyped and its key and/or values may be heterogeneous.
|
||||||
*/
|
*/
|
||||||
public class MapPropertyType extends ScopePropertyType {
|
public class MapPropertyType extends ScopePropertyType {
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import java.util.ArrayList;
|
|||||||
//ORIGINAL LINE: [JsonObject] public class Namespace
|
//ORIGINAL LINE: [JsonObject] public class Namespace
|
||||||
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.
|
* documents.
|
||||||
*/
|
*/
|
||||||
private static final JsonSerializerSettings NamespaceParseSettings = new JsonSerializerSettings() {
|
private static final JsonSerializerSettings NamespaceParseSettings = new JsonSerializerSettings() {
|
||||||
@@ -35,12 +35,12 @@ public class Namespace {
|
|||||||
//ORIGINAL LINE: [JsonProperty(PropertyName = "version")] public SchemaLanguageVersion Version {get;set;}
|
//ORIGINAL LINE: [JsonProperty(PropertyName = "version")] public SchemaLanguageVersion Version {get;set;}
|
||||||
private SchemaLanguageVersion Version = SchemaLanguageVersion.values()[0];
|
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;
|
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() {
|
public Namespace() {
|
||||||
this.setSchemas(new ArrayList<Schema>());
|
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>
|
* <p>
|
||||||
* Namespaces may consist of zero or more table schemas along with zero or more UDT schemas.
|
* 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
|
* 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
|
* 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
|
* 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
|
* 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 {
|
public class ObjectPropertyType extends ScopePropertyType {
|
||||||
/**
|
/**
|
||||||
@@ -21,7 +21,7 @@ public class ObjectPropertyType extends ScopePropertyType {
|
|||||||
private ArrayList<Property> properties;
|
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() {
|
public ObjectPropertyType() {
|
||||||
this.properties = new ArrayList<Property>();
|
this.properties = new ArrayList<Property>();
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ package com.azure.data.cosmos.serialization.hybridrow.schemas;
|
|||||||
public class PartitionKey {
|
public class PartitionKey {
|
||||||
/**
|
/**
|
||||||
* The logical path of the referenced property.
|
* 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:
|
// 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;}
|
//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 {
|
public class PrimarySortKey {
|
||||||
/**
|
/**
|
||||||
* The logical path of the referenced property.
|
* 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:
|
// TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes:
|
||||||
//ORIGINAL LINE: [JsonProperty(PropertyName = "direction", Required = Required.DisallowNull)] public
|
//ORIGINAL LINE: [JsonProperty(PropertyName = "direction", Required = Required.DisallowNull)] public
|
||||||
@@ -19,7 +19,7 @@ public class PrimarySortKey {
|
|||||||
private SortDirection Direction = SortDirection.values()[0];
|
private SortDirection Direction = SortDirection.values()[0];
|
||||||
/**
|
/**
|
||||||
* The logical path of the referenced property.
|
* 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:
|
// 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;}
|
//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.*;
|
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 {
|
public class PropertySchemaConverter extends JsonConverter {
|
||||||
@Override
|
@Override
|
||||||
@@ -35,7 +35,7 @@ public class PropertySchemaConverter extends JsonConverter {
|
|||||||
|
|
||||||
JToken value;
|
JToken value;
|
||||||
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
|
// 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)) {
|
if (!propSchema.TryGetValue("type", out value)) {
|
||||||
throw new JsonSerializationException("Required \"type\" property missing.");
|
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;}
|
//ORIGINAL LINE: [JsonProperty(PropertyName = "id", Required = Required.Always)] public SchemaId SchemaId {get;set;}
|
||||||
private com.azure.data.cosmos.serialization.hybridrow.SchemaId SchemaId = new SchemaId();
|
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:
|
// TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes:
|
||||||
//ORIGINAL LINE: [DefaultValue(TypeKind.Schema)][JsonProperty(PropertyName = "type", Required = Required
|
//ORIGINAL LINE: [DefaultValue(TypeKind.Schema)][JsonProperty(PropertyName = "type", Required = Required
|
||||||
@@ -86,7 +86,7 @@ public class Schema {
|
|||||||
private ArrayList<StaticKey> staticKeys;
|
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() {
|
public Schema() {
|
||||||
this.setType(TypeKind.Schema);
|
this.setType(TypeKind.Schema);
|
||||||
|
|||||||
@@ -16,8 +16,8 @@ public final class SchemaHash {
|
|||||||
// default)
|
// default)
|
||||||
// {
|
// {
|
||||||
// (ulong low, ulong high) hash = seed;
|
// (ulong low, ulong high) hash = seed;
|
||||||
// hash = MurmurHash3.Hash128(schema.SchemaId, hash);
|
// hash = Murmur3Hash.Hash128(schema.SchemaId, hash);
|
||||||
// hash = MurmurHash3.Hash128(schema.Type, hash);
|
// hash = Murmur3Hash.Hash128(schema.Type, hash);
|
||||||
// hash = SchemaHash.ComputeHash(ns, schema.Options, hash);
|
// hash = SchemaHash.ComputeHash(ns, schema.Options, hash);
|
||||||
// if (schema.PartitionKeys != null)
|
// if (schema.PartitionKeys != null)
|
||||||
// {
|
// {
|
||||||
@@ -59,12 +59,12 @@ public final class SchemaHash {
|
|||||||
// seed = default)
|
// seed = default)
|
||||||
// {
|
// {
|
||||||
// (ulong low, ulong high) hash = seed;
|
// (ulong low, ulong high) hash = seed;
|
||||||
// hash = MurmurHash3.Hash128(options == null ? null : options.DisallowUnschematized ?? false, hash);
|
// hash = Murmur3Hash.Hash128(options == null ? null : options.DisallowUnschematized ?? false, hash);
|
||||||
// hash = MurmurHash3.Hash128(options == null ? null : options.EnablePropertyLevelTimestamp ?? false,
|
// hash = Murmur3Hash.Hash128(options == null ? null : options.EnablePropertyLevelTimestamp ?? false,
|
||||||
// hash);
|
// hash);
|
||||||
// if (options == null ? null : options.DisableSystemPrefix ?? false)
|
// if (options == null ? null : options.DisableSystemPrefix ?? false)
|
||||||
// {
|
// {
|
||||||
// hash = MurmurHash3.Hash128(true, hash);
|
// hash = Murmur3Hash.Hash128(true, hash);
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// return hash;
|
// return hash;
|
||||||
@@ -76,7 +76,7 @@ public final class SchemaHash {
|
|||||||
// {
|
// {
|
||||||
// Contract.Requires(p != null);
|
// Contract.Requires(p != null);
|
||||||
// (ulong low, ulong high) hash = seed;
|
// (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);
|
// hash = SchemaHash.ComputeHash(ns, p.PropertyType, hash);
|
||||||
// return hash;
|
// return hash;
|
||||||
// }
|
// }
|
||||||
@@ -87,21 +87,21 @@ public final class SchemaHash {
|
|||||||
// {
|
// {
|
||||||
// Contract.Requires(p != null);
|
// Contract.Requires(p != null);
|
||||||
// (ulong low, ulong high) hash = seed;
|
// (ulong low, ulong high) hash = seed;
|
||||||
// hash = MurmurHash3.Hash128(p.Type, hash);
|
// hash = Murmur3Hash.Hash128(p.Type, hash);
|
||||||
// hash = MurmurHash3.Hash128(p.Nullable, hash);
|
// hash = Murmur3Hash.Hash128(p.Nullable, hash);
|
||||||
// if (p.ApiType != null)
|
// if (p.ApiType != null)
|
||||||
// {
|
// {
|
||||||
// hash = MurmurHash3.Hash128(p.ApiType, hash);
|
// hash = Murmur3Hash.Hash128(p.ApiType, hash);
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// switch (p)
|
// switch (p)
|
||||||
// {
|
// {
|
||||||
// case PrimitivePropertyType pp:
|
// case PrimitivePropertyType pp:
|
||||||
// hash = MurmurHash3.Hash128(pp.Storage, hash);
|
// hash = Murmur3Hash.Hash128(pp.Storage, hash);
|
||||||
// hash = MurmurHash3.Hash128(pp.Length, hash);
|
// hash = Murmur3Hash.Hash128(pp.Length, hash);
|
||||||
// break;
|
// break;
|
||||||
// case ScopePropertyType pp:
|
// case ScopePropertyType pp:
|
||||||
// hash = MurmurHash3.Hash128(pp.Immutable, hash);
|
// hash = Murmur3Hash.Hash128(pp.Immutable, hash);
|
||||||
// switch (p)
|
// switch (p)
|
||||||
// {
|
// {
|
||||||
// case ArrayPropertyType spp:
|
// case ArrayPropertyType spp:
|
||||||
@@ -199,7 +199,7 @@ public final class SchemaHash {
|
|||||||
// (ulong low, ulong high) hash = seed;
|
// (ulong low, ulong high) hash = seed;
|
||||||
// if (key != null)
|
// if (key != null)
|
||||||
// {
|
// {
|
||||||
// hash = MurmurHash3.Hash128(key.Path, hash);
|
// hash = Murmur3Hash.Hash128(key.Path, hash);
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// return hash;
|
// return hash;
|
||||||
@@ -211,8 +211,8 @@ public final class SchemaHash {
|
|||||||
// (ulong low, ulong high) hash = seed;
|
// (ulong low, ulong high) hash = seed;
|
||||||
// if (key != null)
|
// if (key != null)
|
||||||
// {
|
// {
|
||||||
// hash = MurmurHash3.Hash128(key.Path, hash);
|
// hash = Murmur3Hash.Hash128(key.Path, hash);
|
||||||
// hash = MurmurHash3.Hash128(key.Direction, hash);
|
// hash = Murmur3Hash.Hash128(key.Direction, hash);
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// return hash;
|
// return hash;
|
||||||
@@ -224,7 +224,7 @@ public final class SchemaHash {
|
|||||||
// (ulong low, ulong high) hash = seed;
|
// (ulong low, ulong high) hash = seed;
|
||||||
// if (key != null)
|
// if (key != null)
|
||||||
// {
|
// {
|
||||||
// hash = MurmurHash3.Hash128(key.Path, hash);
|
// hash = Murmur3Hash.Hash128(key.Path, hash);
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// return hash;
|
// return hash;
|
||||||
|
|||||||
@@ -165,7 +165,7 @@ HashMap<SchemaId, Schema> ids
|
|||||||
/**
|
/**
|
||||||
* Visit an entire namespace and validate its constraints.
|
* 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 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.
|
* @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.
|
* 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 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.
|
* @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 id The id to check.
|
||||||
* @param label Diagnostic label describing <paramref name="id" />.
|
* @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.
|
* Set properties represent an unbounded set of zero or more unique items.
|
||||||
* <p>
|
* <p>
|
||||||
* Sets may be typed or untyped. Within typed sets, all items MUST be the same type. The
|
* 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
|
* type of items is specified via {@link Items}. Typed sets may be stored more efficiently
|
||||||
* than untyped sets. When <see cref="Items" /> is unspecified, the set is untyped and its items
|
* than untyped sets. When {@link Items} is unspecified, the set is untyped and its items
|
||||||
* may be heterogeneous.
|
* may be heterogeneous.
|
||||||
* <p>
|
* <p>
|
||||||
* Each item within a set must be unique. Uniqueness is defined by the HybridRow encoded sequence
|
* 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 {
|
public class StaticKey {
|
||||||
/**
|
/**
|
||||||
* The logical path of the referenced property.
|
* 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:
|
// 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;}
|
//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.
|
* The property defines a sparse column.
|
||||||
* <p>
|
* <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
|
* 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.
|
* row.
|
||||||
*/
|
*/
|
||||||
Sparse(0),
|
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
|
* present it will also consume a variable number of bytes to encode the length preceding the actual
|
||||||
* value.
|
* value.
|
||||||
* <p>
|
* <p>
|
||||||
* When a <em>long</em> value is marked <see cref="Variable" /> then a null-bit is reserved and
|
* When a <em>long</em> value is marked {@link Variable} then a null-bit is reserved and
|
||||||
* the value is optionally encoded as <see cref="Variable" /> if small enough to fit, otherwise the
|
* 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 <see cref="Sparse" />.
|
* null-bit is set and the value is encoded as {@link Sparse}.
|
||||||
* </p>
|
* </p>
|
||||||
*/
|
*/
|
||||||
Variable(2);
|
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.
|
* Tagged properties pair one or more typed values with an API-specific uint8 type code.
|
||||||
* <p>
|
* <p>
|
||||||
* The uint8 type code is implicitly in position 0 within the resulting tagged and should not
|
* 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 class TaggedPropertyType extends ScopePropertyType {
|
||||||
public static final int MaxTaggedArguments = 2;
|
public static final int MaxTaggedArguments = 2;
|
||||||
@@ -21,7 +21,7 @@ public class TaggedPropertyType extends ScopePropertyType {
|
|||||||
private ArrayList<PropertyType> items;
|
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() {
|
public TaggedPropertyType() {
|
||||||
this.items = new ArrayList<PropertyType>();
|
this.items = new ArrayList<PropertyType>();
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ public class TuplePropertyType extends ScopePropertyType {
|
|||||||
private ArrayList<PropertyType> items;
|
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() {
|
public TuplePropertyType() {
|
||||||
this.items = new ArrayList<PropertyType>();
|
this.items = new ArrayList<PropertyType>();
|
||||||
|
|||||||
@@ -115,19 +115,19 @@ public enum TypeKind {
|
|||||||
Float128(15),
|
Float128(15),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 128-bit floating point value. See <see cref="decimal" />
|
* 128-bit floating point value. See {@link decimal}
|
||||||
*/
|
*/
|
||||||
Decimal(16),
|
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:
|
// TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes:
|
||||||
//ORIGINAL LINE: [EnumMember(Value = "datetime")] DateTime,
|
//ORIGINAL LINE: [EnumMember(Value = "datetime")] DateTime,
|
||||||
DateTime(17),
|
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:
|
// TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes:
|
||||||
//ORIGINAL LINE: [EnumMember(Value = "unixdatetime")] UnixDateTime,
|
//ORIGINAL LINE: [EnumMember(Value = "unixdatetime")] UnixDateTime,
|
||||||
@@ -193,7 +193,7 @@ public enum TypeKind {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* An untyped sparse field.
|
* 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);
|
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