conflict_resolution
stringlengths 27
16k
|
---|
<<<<<<<
public static class IndexQueryHelpers
{
public static IndexQuery FromQueryString(string queryString)
{
var fields = queryString.Split(new[] { '&' }, StringSplitOptions.RemoveEmptyEntries)
.Select(segment =>
{
var parts = segment.Split(new[] { '=' }, StringSplitOptions.RemoveEmptyEntries);
if (parts.Length == 1)
{
return new { Key = parts[0], Value = string.Empty };
}
else
{
return
new
{
Key = parts[0],
Value = Uri.UnescapeDataString(parts[1])
};
}
}).ToLookup(f => f.Key, f => f.Value);
var query = new IndexQuery
{
Query = Uri.UnescapeDataString(fields["query"].FirstOrDefault() ?? ""),
Start = fields.GetStart(),
Cutoff = fields.GetCutOff(),
CutoffEtag = fields.GetCutOffEtag(),
PageSize = fields.GetPageSize(250),
SkipTransformResults = fields.GetSkipTransformResults(),
FieldsToFetch = fields["fetch"].ToArray(),
GroupBy = fields["groupBy"].ToArray(),
AggregationOperation = fields.GetAggregationOperation(),
SortedFields = fields["sort"]
.EmptyIfNull()
.Select(x => new SortedField(x))
.ToArray()
};
double lat = fields.GetLat(), lng = fields.GetLng(), radius = fields.GetRadius();
if (lat != 0 || lng != 0 || radius != 0)
{
return new SpatialIndexQuery(query)
{
QueryShape = SpatialIndexQuery.GetQueryShapeFromLatLon(lat, lng, radius),
SpatialRelation = SpatialRelation.Within, /* TODO */
=======
public static class IndexQueryHelpers
{
public static IndexQuery FromQueryString(string queryString)
{
var fields = queryString.Split(new[] {'&'}, StringSplitOptions.RemoveEmptyEntries)
.Select(segment =>
{
var parts = segment.Split(new[] {'='}, StringSplitOptions.RemoveEmptyEntries);
if (parts.Length == 1)
{
return new {Key = parts[0], Value = string.Empty};
}
else
{
return
new
{
Key = parts[0],
Value = Uri.UnescapeDataString(parts[1])
};
}
}).ToLookup(f => f.Key, f => f.Value);
var query = new IndexQuery
{
Query = Uri.UnescapeDataString(fields["query"].FirstOrDefault() ?? ""),
Start = fields.GetStart(),
Cutoff = fields.GetCutOff(),
CutoffEtag = fields.GetCutOffEtag(),
PageSize = fields.GetPageSize(250),
SkipTransformResults = fields.GetSkipTransformResults(),
FieldsToFetch = fields["fetch"].ToArray(),
GroupBy = fields["groupBy"].ToArray(),
AggregationOperation = fields.GetAggregationOperation(),
SortedFields = fields["sort"]
.EmptyIfNull()
.Select(x => new SortedField(x))
.ToArray()
};
double lat = fields.GetLat(), lng = fields.GetLng(), radius = fields.GetRadius();
SpatialUnits units = fields.GetRadiusUnits();
if (lat != 0 || lng != 0 || radius != 0)
{
return new SpatialIndexQuery(query)
{
QueryShape = SpatialIndexQuery.GetQueryShapeFromLatLon(lat, lng, radius, units),
SpatialRelation = SpatialRelation.Within, /* TODO */
>>>>>>>
public static class IndexQueryHelpers
{
public static IndexQuery FromQueryString(string queryString)
{
var fields = queryString.Split(new[] { '&' }, StringSplitOptions.RemoveEmptyEntries)
.Select(segment =>
{
var parts = segment.Split(new[] { '=' }, StringSplitOptions.RemoveEmptyEntries);
if (parts.Length == 1)
{
return new { Key = parts[0], Value = string.Empty };
}
else
{
return
new
{
Key = parts[0],
Value = Uri.UnescapeDataString(parts[1])
};
}
}).ToLookup(f => f.Key, f => f.Value);
var query = new IndexQuery
{
Query = Uri.UnescapeDataString(fields["query"].FirstOrDefault() ?? ""),
Start = fields.GetStart(),
Cutoff = fields.GetCutOff(),
CutoffEtag = fields.GetCutOffEtag(),
PageSize = fields.GetPageSize(250),
SkipTransformResults = fields.GetSkipTransformResults(),
FieldsToFetch = fields["fetch"].ToArray(),
GroupBy = fields["groupBy"].ToArray(),
AggregationOperation = fields.GetAggregationOperation(),
SortedFields = fields["sort"]
.EmptyIfNull()
.Select(x => new SortedField(x))
.ToArray()
};
double lat = fields.GetLat(), lng = fields.GetLng(), radius = fields.GetRadius();
SpatialUnits units = fields.GetRadiusUnits();
if (lat != 0 || lng != 0 || radius != 0)
{
return new SpatialIndexQuery(query)
{
QueryShape = SpatialIndexQuery.GetQueryShapeFromLatLon(lat, lng, radius, units),
SpatialRelation = SpatialRelation.Within, /* TODO */
<<<<<<<
};
}
return query;
}
public static int GetStart(this ILookup<string, string> fields)
{
int start;
int.TryParse(fields["start"].FirstOrDefault(), out start);
return Math.Max(0, start);
}
public static bool GetSkipTransformResults(this ILookup<string, string> fields)
{
bool result;
bool.TryParse(fields["skipTransformResults"].FirstOrDefault(), out result);
return result;
}
public static int GetPageSize(this ILookup<string, string> fields, int maxPageSize)
{
int pageSize;
if (int.TryParse(fields["pageSize"].FirstOrDefault(), out pageSize) == false || pageSize < 0)
pageSize = 25;
if (pageSize > maxPageSize)
pageSize = maxPageSize;
return pageSize;
}
public static AggregationOperation GetAggregationOperation(this ILookup<string, string> fields)
{
var aggAsString = fields["aggregation"].FirstOrDefault();
if (aggAsString == null)
return AggregationOperation.None;
return (AggregationOperation)Enum.Parse(typeof(AggregationOperation), aggAsString, true);
}
public static DateTime? GetCutOff(this ILookup<string, string> fields)
{
var etagAsString = fields["cutOff"].FirstOrDefault();
if (etagAsString != null)
{
etagAsString = Uri.UnescapeDataString(etagAsString);
DateTime result;
if (DateTime.TryParseExact(etagAsString, "o", CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind, out result))
return result;
return null;
}
return null;
}
public static Etag GetCutOffEtag(this ILookup<string, string> fields)
{
var etagAsString = fields["cutOffEtag"].FirstOrDefault();
if (etagAsString != null)
{
etagAsString = Uri.UnescapeDataString(etagAsString);
try
{
return Etag.Parse(etagAsString);
}
catch (Exception)
{
return null;
}
}
return null;
}
public static double GetLat(this ILookup<string, string> fields)
{
double lat;
double.TryParse(fields["latitude"].FirstOrDefault(), NumberStyles.Any, CultureInfo.InvariantCulture, out lat);
return lat;
}
public static double GetLng(this ILookup<string, string> fields)
{
double lng;
double.TryParse(fields["longitude"].FirstOrDefault(), NumberStyles.Any, CultureInfo.InvariantCulture, out lng);
return lng;
}
public static double GetRadius(this ILookup<string, string> fields)
{
double radius;
double.TryParse(fields["radius"].FirstOrDefault(), NumberStyles.Any, CultureInfo.InvariantCulture, out radius);
return radius;
}
public static Guid? GetEtagFromQueryString(this ILookup<string, string> fields)
{
var etagAsString = fields["etag"].FirstOrDefault();
if (etagAsString != null)
{
Guid result;
if (Guid.TryParse(etagAsString, out result))
return result;
return null;
}
return null;
}
}
=======
};
}
return query;
}
public static int GetStart(this ILookup<string,string> fields)
{
int start;
int.TryParse(fields["start"].FirstOrDefault(), out start);
return Math.Max(0, start);
}
public static bool GetSkipTransformResults(this ILookup<string, string> fields)
{
bool result;
bool.TryParse(fields["skipTransformResults"].FirstOrDefault(), out result);
return result;
}
public static int GetPageSize(this ILookup<string, string> fields, int maxPageSize)
{
int pageSize;
if (int.TryParse(fields["pageSize"].FirstOrDefault(), out pageSize) == false || pageSize < 0)
pageSize = 25;
if (pageSize > maxPageSize)
pageSize = maxPageSize;
return pageSize;
}
public static AggregationOperation GetAggregationOperation(this ILookup<string, string> fields)
{
var aggAsString = fields["aggregation"].FirstOrDefault();
if (aggAsString == null)
return AggregationOperation.None;
return (AggregationOperation)Enum.Parse(typeof(AggregationOperation), aggAsString, true);
}
public static DateTime? GetCutOff(this ILookup<string, string> fields)
{
var etagAsString = fields["cutOff"].FirstOrDefault();
if (etagAsString != null)
{
etagAsString = Uri.UnescapeDataString(etagAsString);
DateTime result;
if (DateTime.TryParseExact(etagAsString, "o", CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind, out result))
return result;
return null;
}
return null;
}
public static Guid? GetCutOffEtag(this ILookup<string, string> fields)
{
var etagAsString = fields["cutOffEtag"].FirstOrDefault();
if (etagAsString != null)
{
etagAsString = Uri.UnescapeDataString(etagAsString);
Guid result;
if (Guid.TryParse(etagAsString, out result))
return result;
return null;
}
return null;
}
public static double GetLat(this ILookup<string, string> fields)
{
double lat;
double.TryParse(fields["latitude"].FirstOrDefault(), NumberStyles.Any, CultureInfo.InvariantCulture, out lat);
return lat;
}
public static double GetLng(this ILookup<string, string> fields)
{
double lng;
double.TryParse(fields["longitude"].FirstOrDefault(), NumberStyles.Any, CultureInfo.InvariantCulture, out lng);
return lng;
}
public static double GetRadius(this ILookup<string, string> fields)
{
double radius;
double.TryParse(fields["radius"].FirstOrDefault(), NumberStyles.Any, CultureInfo.InvariantCulture, out radius);
return radius;
}
public static SpatialUnits GetRadiusUnits(this ILookup<string, string> fields)
{
var units = fields["units"].FirstOrDefault();
SpatialUnits parsedUnit;
if (Enum.TryParse<SpatialUnits>(units, out parsedUnit))
{
return parsedUnit;
}
return SpatialUnits.Kilometers;
}
public static Guid? GetEtagFromQueryString(this ILookup<string, string> fields)
{
var etagAsString = fields["etag"].FirstOrDefault();
if (etagAsString != null)
{
Guid result;
if (Guid.TryParse(etagAsString, out result))
return result;
return null;
}
return null;
}
}
>>>>>>>
};
}
return query;
}
public static int GetStart(this ILookup<string, string> fields)
{
int start;
int.TryParse(fields["start"].FirstOrDefault(), out start);
return Math.Max(0, start);
}
public static bool GetSkipTransformResults(this ILookup<string, string> fields)
{
bool result;
bool.TryParse(fields["skipTransformResults"].FirstOrDefault(), out result);
return result;
}
public static int GetPageSize(this ILookup<string, string> fields, int maxPageSize)
{
int pageSize;
if (int.TryParse(fields["pageSize"].FirstOrDefault(), out pageSize) == false || pageSize < 0)
pageSize = 25;
if (pageSize > maxPageSize)
pageSize = maxPageSize;
return pageSize;
}
public static AggregationOperation GetAggregationOperation(this ILookup<string, string> fields)
{
var aggAsString = fields["aggregation"].FirstOrDefault();
if (aggAsString == null)
return AggregationOperation.None;
return (AggregationOperation)Enum.Parse(typeof(AggregationOperation), aggAsString, true);
}
public static DateTime? GetCutOff(this ILookup<string, string> fields)
{
var etagAsString = fields["cutOff"].FirstOrDefault();
if (etagAsString != null)
{
etagAsString = Uri.UnescapeDataString(etagAsString);
DateTime result;
if (DateTime.TryParseExact(etagAsString, "o", CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind, out result))
return result;
return null;
}
return null;
}
public static Etag GetCutOffEtag(this ILookup<string, string> fields)
{
var etagAsString = fields["cutOffEtag"].FirstOrDefault();
if (etagAsString != null)
{
etagAsString = Uri.UnescapeDataString(etagAsString);
try
{
return Etag.Parse(etagAsString);
}
catch (Exception)
{
return null;
}
}
return null;
}
public static double GetLat(this ILookup<string, string> fields)
{
double lat;
double.TryParse(fields["latitude"].FirstOrDefault(), NumberStyles.Any, CultureInfo.InvariantCulture, out lat);
return lat;
}
public static double GetLng(this ILookup<string, string> fields)
{
double lng;
double.TryParse(fields["longitude"].FirstOrDefault(), NumberStyles.Any, CultureInfo.InvariantCulture, out lng);
return lng;
}
public static double GetRadius(this ILookup<string, string> fields)
{
double radius;
double.TryParse(fields["radius"].FirstOrDefault(), NumberStyles.Any, CultureInfo.InvariantCulture, out radius);
return radius;
}
public static SpatialUnits GetRadiusUnits(this ILookup<string, string> fields)
{
var units = fields["units"].FirstOrDefault();
SpatialUnits parsedUnit;
if (Enum.TryParse<SpatialUnits>(units, out parsedUnit))
{
return parsedUnit;
}
return SpatialUnits.Kilometers;
}
public static Guid? GetEtagFromQueryString(this ILookup<string, string> fields)
{
var etagAsString = fields["etag"].FirstOrDefault();
if (etagAsString != null)
{
Guid result;
if (Guid.TryParse(etagAsString, out result))
return result;
return null;
}
return null;
}
} |
<<<<<<<
private Etag HandleDocumentIndexing(IList<IndexToWorkOn> indexesToWorkOn, List<JsonDocument> jsonDocs)
=======
private Guid DoActualIndexing(IList<IndexToWorkOn> indexesToWorkOn, List<JsonDocument> jsonDocs)
>>>>>>>
private Etag DoActualIndexing(IList<IndexToWorkOn> indexesToWorkOn, List<JsonDocument> jsonDocs)
<<<<<<<
public Etag LastIndexedEtag { get; set; }
=======
public Index Index { get; set; }
public Guid LastIndexedEtag { get; set; }
>>>>>>>
public Index Index { get; set; }
public Etag LastIndexedEtag { get; set; } |
<<<<<<<
this.HighlightedFields.ApplyIfNotNull(field => path.Append("&highlight=").Append(field));
this.HighlighterPreTags.ApplyIfNotNull(tag=>path.Append("&preTags=").Append(tag));
this.HighlighterPostTags.ApplyIfNotNull(tag=>path.Append("&postTags=").Append(tag));
var vars = GetCustomQueryStringVariables();
=======
if(DebugOptionGetIndexEntries)
path.Append("&debug=entries");
}
>>>>>>>
this.HighlightedFields.ApplyIfNotNull(field => path.Append("&highlight=").Append(field));
this.HighlighterPreTags.ApplyIfNotNull(tag=>path.Append("&preTags=").Append(tag));
this.HighlighterPostTags.ApplyIfNotNull(tag=>path.Append("&postTags=").Append(tag));
if(DebugOptionGetIndexEntries)
path.Append("&debug=entries");
} |
<<<<<<<
public abstract class AbstractIndexCreationTask : AbstractCommonApiForIndexesAndTransformers
=======
#endif
public abstract class AbstractIndexCreationTask
>>>>>>>
#endif
public abstract class AbstractIndexCreationTask : AbstractCommonApiForIndexesAndTransformers |
<<<<<<<
JObject meta;
JObject jsonData;
=======
RavenJObject meta = null;
RavenJObject jsonData = null;
>>>>>>>
RavenJObject meta = null;
RavenJObject jsonData = null;
<<<<<<<
private JsonDocument[] DirectStartsWith(string operationUrl, string keyPrefix, int start, int pageSize)
{
var metadata = new JObject();
AddTransactionInformation(metadata);
var actualUrl = string.Format("{0}/docs?startsWith={1}&start={2}&pageSize={3}", operationUrl, Uri.EscapeDataString(keyPrefix), start, pageSize);
var request = jsonRequestFactory.CreateHttpJsonRequest(this, actualUrl, "GET", metadata, credentials, convention);
request.AddOperationHeaders(OperationsHeaders);
string readResponseString;
try
{
readResponseString = request.ReadResponseString();
}
catch (WebException e)
{
var httpWebResponse = e.Response as HttpWebResponse;
if (httpWebResponse == null ||
httpWebResponse.StatusCode != HttpStatusCode.Conflict)
throw;
throw ThrowConcurrencyException(e);
}
return SerializationHelper.JObjectsToJsonDocuments(JArray.Parse(readResponseString).OfType<JObject>()).ToArray();
}
private PutResult DirectPut(JObject metadata, string key, Guid? etag, JObject document, string operationUrl)
=======
private PutResult DirectPut(RavenJObject metadata, string key, Guid? etag, RavenJObject document, string operationUrl)
>>>>>>>
private JsonDocument[] DirectStartsWith(string operationUrl, string keyPrefix, int start, int pageSize)
{
var metadata = new JObject();
AddTransactionInformation(metadata);
var actualUrl = string.Format("{0}/docs?startsWith={1}&start={2}&pageSize={3}", operationUrl, Uri.EscapeDataString(keyPrefix), start, pageSize);
var request = jsonRequestFactory.CreateHttpJsonRequest(this, actualUrl, "GET", metadata, credentials, convention);
request.AddOperationHeaders(OperationsHeaders);
string readResponseString;
try
{
readResponseString = request.ReadResponseString();
}
catch (WebException e)
{
var httpWebResponse = e.Response as HttpWebResponse;
if (httpWebResponse == null ||
httpWebResponse.StatusCode != HttpStatusCode.Conflict)
throw;
throw ThrowConcurrencyException(e);
}
return SerializationHelper.JObjectsToJsonDocuments(JArray.Parse(readResponseString).OfType<JObject>()).ToArray();
}
private PutResult DirectPut(JObject metadata, string key, Guid? etag, JObject document, string operationUrl)
private PutResult DirectPut(RavenJObject metadata, string key, Guid? etag, RavenJObject document, string operationUrl)
<<<<<<<
metadata["ETag"] = new JValue(etag.Value.ToString());
var request = jsonRequestFactory.CreateHttpJsonRequest(this, operationUrl + "/docs/" + key, method, metadata, credentials, convention);
=======
metadata["ETag"] = new RavenJValue(etag.Value.ToString());
var request = HttpJsonRequest.CreateHttpJsonRequest(this, operationUrl + "/docs/" + key, method, metadata, credentials, convention);
>>>>>>>
metadata["ETag"] = new RavenJValue(etag.Value.ToString());
var request = jsonRequestFactory.CreateHttpJsonRequest(this, operationUrl + "/docs/" + key, method, metadata, credentials, convention);
<<<<<<<
request = jsonRequestFactory.CreateHttpJsonRequest(this, path, "POST", credentials, convention);
request.Write(new JArray(ids).ToString(Formatting.None));
=======
request = HttpJsonRequest.CreateHttpJsonRequest(this, path, "POST", credentials, convention);
request.Write(new RavenJArray(ids).ToString(Formatting.None));
>>>>>>>
request = jsonRequestFactory.CreateHttpJsonRequest(this, path, "POST", credentials, convention);
request.Write(new RavenJArray(ids).ToString(Formatting.None)); |
<<<<<<<
using Raven.Abstractions.Data;
using Raven.Abstractions.Util;
=======
using Raven.Abstractions.Util;
using Raven.Database.Extensions;
using Raven.Database.Impl;
>>>>>>>
using Raven.Abstractions.Util;
using Raven.Abstractions.Data;
using Raven.Abstractions.Util;
<<<<<<<
public IEnumerable<ListItem> Read(string name, Etag start, int take)
=======
public IEnumerable<ListItem> Read(string name, Guid start, Guid? end, int take)
>>>>>>>
public IEnumerable<ListItem> Read(string name, Etag start, Etag end, int take)
<<<<<<<
var etag = Etag.Parse(Api.RetrieveColumn(session, Lists, tableColumnsCache.ListsColumns["etag"]));
=======
var etag = Api.RetrieveColumn(session, Lists, tableColumnsCache.ListsColumns["etag"]).TransfromToGuidWithProperSorting();
if (endComparer != null && endComparer.CompareTo(etag) <= 0)
yield break;
count++;
>>>>>>>
var etag = Etag.Parse(Api.RetrieveColumn(session, Lists, tableColumnsCache.ListsColumns["etag"]));
if (endComparer != null && endComparer.CompareTo(etag) <= 0)
yield break;
count++; |
<<<<<<<
using Raven.Database.Indexing;
using System.Linq;
=======
using System.Linq;
>>>>>>>
using System.Linq;
using System.Linq; |
<<<<<<<
/*
* User: scorder
*/
using System;
using System.IO;
using System.Text;
using MongoDB.Driver.Bson;
namespace MongoDB.Driver.IO
{
/// <summary>
/// Description of GetMoreMessage.
/// </summary>
public class GetMoreMessage : RequestMessage
{
// struct {
// MsgHeader header; // standard message header
// int32 ZERO; // 0 - reserved for future use
// cstring fullCollectionName; // "dbname.collectionname"
// int32 numberToReturn; // number of documents to return
// int64 cursorID; // cursorID from the OP_REPLY
// }
#region "Properties"
private long cursorID;
public long CursorID {
get { return cursorID; }
set { cursorID = value; }
}
private string fullCollectionName;
public string FullCollectionName {
get { return fullCollectionName; }
set { fullCollectionName = value; }
}
private Int32 numberToReturn;
public int NumberToReturn {
get { return numberToReturn; }
set { numberToReturn = value; }
}
#endregion
public GetMoreMessage(string fullCollectionName, long cursorID)
:this(fullCollectionName, cursorID, 0){
}
public GetMoreMessage(string fullCollectionName, long cursorID, int numberToReturn){
this.Header = new MessageHeader(OpCode.GetMore);
this.FullCollectionName = fullCollectionName;
this.CursorID = cursorID;
this.NumberToReturn = numberToReturn;
}
protected override void WriteBody (BsonWriter2 writer){
writer.WriteValue(BsonDataType.Integer,0);
writer.WriteString(this.FullCollectionName);
writer.WriteValue(BsonDataType.Integer,this.NumberToReturn);
writer.WriteValue(BsonDataType.Long,this.CursorID);
}
protected override int CalculateBodySize(BsonWriter2 writer){
int size = 4; //first int32
size += writer.CalculateSize(this.FullCollectionName,false);
size += 12; //number to return + cursorid
return size;
}
}
}
=======
/*
* User: scorder
*/
using System;
using System.IO;
using System.Text;
using MongoDB.Driver.Bson;
namespace MongoDB.Driver.IO
{
/// <summary>
/// Description of GetMoreMessage.
/// </summary>
public class GetMoreMessage : RequestMessage
{
// struct {
// MsgHeader header; // standard message header
// int32 ZERO; // 0 - reserved for future use
// cstring fullCollectionName; // "dbname.collectionname"
// int32 numberToReturn; // number of documents to return
// int64 cursorID; // cursorID from the OP_REPLY
// }
#region "Properties"
private long cursorID;
public long CursorID {
get { return cursorID; }
set { cursorID = value; }
}
private string fullCollectionName;
public string FullCollectionName {
get { return fullCollectionName; }
set { fullCollectionName = value; }
}
private Int32 numberToReturn;
public int NumberToReturn {
get { return numberToReturn; }
set { numberToReturn = value; }
}
#endregion
public GetMoreMessage(string fullCollectionName, long cursorID)
:this(fullCollectionName, cursorID, 0){
}
public GetMoreMessage(string fullCollectionName, long cursorID, int numberToReturn){
this.Header = new MessageHeader(OpCode.GetMore);
this.FullCollectionName = fullCollectionName;
this.CursorID = cursorID;
this.NumberToReturn = numberToReturn;
}
protected override void WriteBody (BsonWriter2 writer){
writer.WriteValue(BsonDataType.Integer,0);
writer.WriteString(this.FullCollectionName);
writer.WriteValue(BsonDataType.Integer,this.NumberToReturn);
writer.WriteValue(BsonDataType.Long,this.CursorID);
}
protected override int CalculateBodySize(BsonWriter2 writer){
int size = 4; //first int32
size += writer.CalculateSize(this.FullCollectionName,false);
size += 12; //number to return + cursorid
return size;
}
}
}
>>>>>>>
using System;
using System.IO;
using System.Text;
using MongoDB.Driver.Bson;
namespace MongoDB.Driver.IO
{
/// <summary>
/// Description of GetMoreMessage.
/// </summary>
public class GetMoreMessage : RequestMessage
{
// struct {
// MsgHeader header; // standard message header
// int32 ZERO; // 0 - reserved for future use
// cstring fullCollectionName; // "dbname.collectionname"
// int32 numberToReturn; // number of documents to return
// int64 cursorID; // cursorID from the OP_REPLY
// }
#region "Properties"
private long cursorID;
public long CursorID {
get { return cursorID; }
set { cursorID = value; }
}
private string fullCollectionName;
public string FullCollectionName {
get { return fullCollectionName; }
set { fullCollectionName = value; }
}
private Int32 numberToReturn;
public int NumberToReturn {
get { return numberToReturn; }
set { numberToReturn = value; }
}
#endregion
public GetMoreMessage(string fullCollectionName, long cursorID)
:this(fullCollectionName, cursorID, 0){
}
public GetMoreMessage(string fullCollectionName, long cursorID, int numberToReturn){
this.Header = new MessageHeader(OpCode.GetMore);
this.FullCollectionName = fullCollectionName;
this.CursorID = cursorID;
this.NumberToReturn = numberToReturn;
}
protected override void WriteBody (BsonWriter2 writer){
writer.WriteValue(BsonDataType.Integer,0);
writer.WriteString(this.FullCollectionName);
writer.WriteValue(BsonDataType.Integer,this.NumberToReturn);
writer.WriteValue(BsonDataType.Long,this.CursorID);
}
protected override int CalculateBodySize(BsonWriter2 writer){
int size = 4; //first int32
size += writer.CalculateSize(this.FullCollectionName,false);
size += 12; //number to return + cursorid
return size;
}
}
} |
<<<<<<<
if (properties == null)
{
properties = TypeDescriptor.GetProperties(doc);
}
var abstractFields = anonymousObjectToLuceneDocumentConverter.Index(doc, properties, Field.Store.NO).ToList();
=======
var properties = TypeDescriptor.GetProperties(doc);
var abstractFields = anonymousObjectToLuceneDocumentConverter.Index(doc, properties, indexDefinition, Field.Store.NO).ToList();
>>>>>>>
var properties = TypeDescriptor.GetProperties(doc);
var abstractFields = anonymousObjectToLuceneDocumentConverter.Index(doc, properties, Field.Store.NO).ToList(); |
<<<<<<<
var doc = new RavenJObject(DataAsJson); //clone the document
var metadata = new RavenJObject(Metadata); // clone the metadata
metadata["Last-Modified"] = RavenJToken.FromObject(LastModified.ToString("r"));
metadata["@etag"] = Etag.ToString();
doc["@metadata"] = metadata;
metadata["Non-Authoritive-Information"] = RavenJToken.FromObject(NonAuthoritiveInformation);
=======
var doc = new JObject(DataAsJson); //clone the document
var metadata = new JObject(Metadata); // clone the metadata
metadata["Last-Modified"] = LastModified;
var etagProp = metadata.Property("@etag");
if (etagProp == null)
{
etagProp = new JProperty("@etag");
metadata.Add(etagProp);
}
etagProp.Value = new JValue(Etag.ToString());
doc.Add("@metadata", metadata);
metadata["Non-Authoritive-Information"] = JToken.FromObject(NonAuthoritiveInformation);
>>>>>>>
var doc = new RavenJObject(DataAsJson); //clone the document
var metadata = new RavenJObject(Metadata); // clone the metadata
metadata["Last-Modified"] = LastModified;
metadata["@etag"] = Etag.ToString();
doc["@metadata"] = metadata;
metadata["Non-Authoritive-Information"] = RavenJToken.FromObject(NonAuthoritiveInformation); |
<<<<<<<
var multiLoadResult = DatabaseCommands.Get(ids, new string[] {}, transformer, queryInputs);
return new LoadTransformerOperation(this, transformer, ids.Length).Complete<T>(multiLoadResult);
}
internal object ProjectionToInstance(RavenJObject y, Type type)
{
HandleInternalMetadata(y);
foreach (var conversionListener in listeners.ExtendedConversionListeners)
{
conversionListener.BeforeConversionToEntity(null, y, null);
}
var instance = y.Deserialize(type, Conventions);
foreach (var conversionListener in listeners.ConversionListeners)
{
conversionListener.DocumentToEntity(null, instance, y, null);
}
foreach (var conversionListener in listeners.ExtendedConversionListeners)
{
conversionListener.AfterConversionToEntity(null, y, null, instance);
}
return instance;
}
=======
var items = DatabaseCommands.Get(ids, new string[] { }, transformer, queryInputs).Results
.Select(x =>
{
var result = JsonObjectToClrInstancesWithoutTracking(typeof (T), x);
var array = result as Array;
if (array != null && typeof(T).IsArray == false && array.Length > ids.Length)
{
throw new InvalidOperationException(
String.Format(
"A load was attempted with transformer {0}, and more than one item was returned per entity - please use {1}[] as the projection type instead of {1}",
transformer,
typeof(T).Name));
}
return result;
})
.Cast<T>()
.ToArray();
return items;
}
>>>>>>>
var multiLoadResult = DatabaseCommands.Get(ids, new string[] { }, transformer, queryInputs);
return new LoadTransformerOperation(this, transformer, ids.Length).Complete<T>(multiLoadResult);
}
internal object ProjectionToInstance(RavenJObject y, Type type)
{
HandleInternalMetadata(y);
foreach (var conversionListener in listeners.ExtendedConversionListeners)
{
conversionListener.BeforeConversionToEntity(null, y, null);
}
var instance = y.Deserialize(type, Conventions);
foreach (var conversionListener in listeners.ConversionListeners)
{
conversionListener.DocumentToEntity(null, instance, y, null);
}
foreach (var conversionListener in listeners.ExtendedConversionListeners)
{
conversionListener.AfterConversionToEntity(null, y, null, instance);
}
return instance;
} |
<<<<<<<
public static int MaximumMessageSize = 1024 * 1024 * 4;
public MessageHeader Header { get; set; }
=======
public MessageHeader Header { get; protected set; }
>>>>>>>
public static int MaximumMessageSize = 1024 * 1024 * 4;
public MessageHeader Header { get; protected set; } |
<<<<<<<
using System;
using System.Collections.Generic;
=======
using System.Collections;
using System.Collections.Generic;
>>>>>>>
using System.Collections;
using System.Collections.Generic;
<<<<<<<
using System.Security.Cryptography;
=======
using Lucene.Net.Analysis;
>>>>>>>
using System.Security.Cryptography;
using Lucene.Net.Analysis;
<<<<<<<
using Raven.Json.Linq;
=======
using Constants = Raven.Abstractions.Data.Constants;
>>>>>>>
using Raven.Json.Linq;
using Constants = Raven.Abstractions.Data.Constants; |
<<<<<<<
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Raven.Imports.Newtonsoft.Json;
namespace Raven.Munin.Tests
{
public class ToDoRepository
{
readonly Database database;
private Table todos;
public ToDoRepository(IPersistentSource source)
{
database = new Database(source);
todos = database.Add(new Table("todo"));
database.Initialze();
}
public Guid Save(ToDo todo)
{
database.BeginTransaction();
var id = Guid.NewGuid();
var ms = new MemoryStream();
var jsonTextWriter = new JsonTextWriter(new StreamWriter(ms));
new JsonSerializer().Serialize(
jsonTextWriter,
todo
);
jsonTextWriter.Flush();
todos.Put(id.ToByteArray(), ms.ToArray());
database.Commit();
return id;
}
public ToDo Get(Guid guid)
{
var readResult = todos.Read(guid.ToByteArray());
if (readResult == null)
return null;
var bytes = readResult.Data();
return ConvertToToDo(bytes);
}
private static ToDo ConvertToToDo(byte[] bytes)
{
var memoryStream = new MemoryStream(bytes);
return new JsonSerializer().Deserialize<ToDo>(new JsonTextReader(new StreamReader(memoryStream)));
}
public IEnumerable<ToDo> All()
{
return from item in todos
select ConvertToToDo(item.Data());
}
}
=======
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Newtonsoft.Json;
namespace Raven.Munin.Tests
{
public class ToDoRepository
{
readonly Database database;
private Table todos;
public ToDoRepository(IPersistentSource source)
{
database = new Database(source);
todos = database.Add(new Table("todo"));
database.Initialze();
}
public Guid Save(ToDo todo)
{
database.BeginTransaction();
var id = Guid.NewGuid();
var ms = new MemoryStream();
var jsonTextWriter = new JsonTextWriter(new StreamWriter(ms));
new JsonSerializer().Serialize(
jsonTextWriter,
todo
);
jsonTextWriter.Flush();
todos.Put(id.ToByteArray(), ms.ToArray());
database.Commit();
return id;
}
public ToDo Get(Guid guid)
{
using(database.BeginTransaction())
{
var readResult = todos.Read(guid.ToByteArray());
if (readResult == null)
return null;
var bytes = readResult.Data();
return ConvertToToDo(bytes);
}
}
private static ToDo ConvertToToDo(byte[] bytes)
{
var memoryStream = new MemoryStream(bytes);
return new JsonSerializer().Deserialize<ToDo>(new JsonTextReader(new StreamReader(memoryStream)));
}
public IEnumerable<ToDo> All()
{
return from item in todos
select ConvertToToDo(item.Data());
}
}
>>>>>>>
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Raven.Imports.Newtonsoft.Json;
namespace Raven.Munin.Tests
{
public class ToDoRepository
{
readonly Database database;
private Table todos;
public ToDoRepository(IPersistentSource source)
{
database = new Database(source);
todos = database.Add(new Table("todo"));
database.Initialze();
}
public Guid Save(ToDo todo)
{
database.BeginTransaction();
var id = Guid.NewGuid();
var ms = new MemoryStream();
var jsonTextWriter = new JsonTextWriter(new StreamWriter(ms));
new JsonSerializer().Serialize(
jsonTextWriter,
todo
);
jsonTextWriter.Flush();
todos.Put(id.ToByteArray(), ms.ToArray());
database.Commit();
return id;
}
public ToDo Get(Guid guid)
{
using(database.BeginTransaction())
{
var readResult = todos.Read(guid.ToByteArray());
if (readResult == null)
return null;
var bytes = readResult.Data();
return ConvertToToDo(bytes);
}
}
private static ToDo ConvertToToDo(byte[] bytes)
{
var memoryStream = new MemoryStream(bytes);
return new JsonSerializer().Deserialize<ToDo>(new JsonTextReader(new StreamReader(memoryStream)));
}
public IEnumerable<ToDo> All()
{
return from item in todos
select ConvertToToDo(item.Data());
}
} |
<<<<<<<
private const string IndexVersion = "1.2.17";
=======
private readonly DocumentDatabase documentDatabase;
>>>>>>>
private readonly DocumentDatabase documentDatabase;
private const string IndexVersion = "1.2.17"; |
<<<<<<<
using System.Linq;
=======
using Raven.Database.Indexing;
>>>>>>>
using System.Linq;
using Raven.Database.Indexing;
<<<<<<<
var result = databaseCommands.Query(indexName, query, start, pageSize, projectionFields);
=======
var result = databaseCommands.Query(indexName, new IndexQuery(query, start, pageSize));
>>>>>>>
var result = databaseCommands.Query(indexName, new IndexQuery(query, start, pageSize)); |
<<<<<<<
#if !SILVERLIGHT && !NETFX_CORE
MaxNumberOfCachedRequests = 2048;
=======
#if !SILVERLIGHT
>>>>>>>
#if !SILVERLIGHT && !NETFX_CORE
<<<<<<<
#if !SILVERLIGHT && !NETFX_CORE
jsonRequestFactory = new HttpJsonRequestFactory(MaxNumberOfCachedRequests);
#else
jsonRequestFactory = new HttpJsonRequestFactory();
#endif
=======
>>>>>>>
#if !SILVERLIGHT && !NETFX_CORE
jsonRequestFactory = new HttpJsonRequestFactory(MaxNumberOfCachedRequests);
#else
jsonRequestFactory = new HttpJsonRequestFactory();
#endif |
<<<<<<<
var databaseAccess = tokenBody.AuthorizedDatabases.FirstOrDefault(x=>string.Equals(x.TenantId, tenantId, StringComparison.OrdinalIgnoreCase) || x.TenantId == "*");
if (databaseAccess == null)
return false;
=======
var databaseAccess = tokenBody.AuthorizedDatabases
.Where(x=>
string.Equals(x.TenantId, tenantId, StringComparison.InvariantCultureIgnoreCase) ||
x.TenantId == "*");
>>>>>>>
var databaseAccess = tokenBody.AuthorizedDatabases
.Where(x=>
string.Equals(x.TenantId, tenantId, StringComparison.OrdinalIgnoreCase) ||
x.TenantId == "*"); |
<<<<<<<
/*
* User: scorder
* Date: 7/8/2009
*/
using System;
using System.Collections.Generic;
using MongoDB.Driver.Bson;
using MongoDB.Driver.IO;
namespace MongoDB.Driver
{
/// <summary>
/// Description of Collection.
/// </summary>
public class Collection
{
private Connection connection;
private string name;
public string Name {
get { return name; }
}
private string dbName;
public string DbName {
get { return dbName; }
}
public string FullName{
get{ return dbName + "." + name;}
}
public Collection(string name, Connection conn, string dbName)
{
this.name = name;
this.connection = conn;
this.dbName = dbName;
}
public Document FindOne(Document spec){
Cursor cur = this.Find(spec, -1,0,null);
foreach(Document doc in cur.Documents){
cur.Dispose();
return doc;
}
//FIXME Decide if this should throw a not found exception instead of returning null.
return null; //this.Find(spec, -1, 0, null)[0];
}
public Cursor FindAll(){
Document spec = new Document();
return this.Find(spec, 0, 0, null);
}
public Cursor Find(Document spec){
return this.Find(spec, 0, 0, null);
}
public Cursor Find(Document spec, int limit, int skip){
return this.Find(spec, limit, skip, null);
}
public Cursor Find(Document spec, int limit, int skip, Document fields){
if(spec == null) spec = new Document();
Cursor cur = new Cursor(connection, this.FullName, spec, limit, skip, fields);
return cur;
}
public void Insert(Document doc){
Document[] docs = new Document[]{doc,};
this.Insert(docs);
}
public void Insert(List<Document> docs){
this.Insert(docs.ToArray());
}
public void Insert(Document[] docs){
InsertMessage im = new InsertMessage();
im.FullCollectionName = this.FullName;
List<BsonDocument> bdocs = new List<BsonDocument>(docs.Length);
foreach(Document doc in docs){
bdocs.Add(BsonConvert.From(doc));
}
im.BsonDocuments = bdocs.ToArray();
this.connection.SendMessage(im);
}
public void Delete(Document selector){
DeleteMessage dm = new DeleteMessage();
dm.FullCollectionName = this.FullName;
dm.Selector = BsonConvert.From(selector);
this.connection.SendMessage(dm);
}
public void Update(Document doc){
//Try to generate a selector using _id for an existing document.
//otherwise just set the upsert flag to 1 to insert and send onward.
Document selector = new Document();
int upsert = 0;
if(doc["_id"] != null){
selector["_id"] = doc["_id"];
}else{
//Likely a new document
upsert = 1;
}
this.Update(doc, selector, upsert);
}
public void Update(Document doc, Document selector){
this.Update(doc, selector, 0);
}
public void Update(Document doc, Document selector, int upsert){
UpdateMessage um = new UpdateMessage();
um.FullCollectionName = this.FullName;
um.Selector = BsonConvert.From(selector);
um.Document = BsonConvert.From(doc);
um.Upsert = upsert;
this.connection.SendMessage(um);
}
public void UpdateAll(Document doc, Document selector){
Cursor toUpdate = this.Find(selector);
foreach(Document udoc in toUpdate.Documents){
Document updSel = new Document();
updSel["_id"] = udoc["_id"];
udoc.Update(doc);
this.Update(udoc, updSel,0);
}
}
}
}
=======
/*
* User: scorder
* Date: 7/8/2009
*/
using System;
using System.Collections.Generic;
using MongoDB.Driver.Bson;
using MongoDB.Driver.IO;
namespace MongoDB.Driver
{
/// <summary>
/// Description of Collection.
/// </summary>
public class Collection
{
private Connection connection;
private string name;
public string Name {
get { return name; }
}
private string dbName;
public string DbName {
get { return dbName; }
}
public string FullName{
get{ return dbName + "." + name;}
}
private CollectionMetaData metaData;
public CollectionMetaData MetaData {
get {
if(metaData == null){
metaData = new CollectionMetaData(this.dbName,this.name, this.connection);
}
return metaData;
}
}
public Collection(string name, Connection conn, string dbName)
{
this.name = name;
this.connection = conn;
this.dbName = dbName;
}
public Document FindOne(Document spec){
Cursor cur = this.Find(spec, -1,0,null);
foreach(Document doc in cur.Documents){
cur.Dispose();
return doc;
}
//FIXME Decide if this should throw a not found exception instead of returning null.
return null; //this.Find(spec, -1, 0, null)[0];
}
public Cursor FindAll(){
Document spec = new Document();
return this.Find(spec, 0, 0, null);
}
public Cursor Find(Document spec){
return this.Find(spec, 0, 0, null);
}
public Cursor Find(Document spec, int limit, int skip){
return this.Find(spec, limit, skip, null);
}
public Cursor Find(Document spec, int limit, int skip, Document fields){
if(spec == null) spec = new Document();
Cursor cur = new Cursor(connection, this.FullName, spec, limit, skip, fields);
return cur;
}
public long Count(){
return this.Count(new Document());
}
public long Count(Document spec){
Database db = new Database(this.connection, this.dbName);
Collection cmd = db["$cmd"];
Document ret = cmd.FindOne(new Document().Append("count",this.Name).Append("query",spec));
if(ret.Contains("ok") && (double)ret["ok"] == 1){
double n = (double)ret["n"];
return Convert.ToInt64(n);
}else{
//FIXME This is an exception condition when the namespace is missing. -1 might be better here but the console returns 0.
return 0;
}
}
public void Insert(Document doc){
Document[] docs = new Document[]{doc,};
this.Insert(docs);
}
public void Insert(List<Document> docs){
this.Insert(docs.ToArray());
}
public void Insert(Document[] docs){
InsertMessage im = new InsertMessage();
im.FullCollectionName = this.FullName;
List<BsonDocument> bdocs = new List<BsonDocument>(docs.Length);
foreach(Document doc in docs){
bdocs.Add(BsonConvert.From(doc));
}
im.BsonDocuments = bdocs.ToArray();
this.connection.SendMessage(im);
}
public void Delete(Document selector){
DeleteMessage dm = new DeleteMessage();
dm.FullCollectionName = this.FullName;
dm.Selector = BsonConvert.From(selector);
this.connection.SendMessage(dm);
}
public void Update(Document doc){
//Try to generate a selector using _id for an existing document.
//otherwise just set the upsert flag to 1 to insert and send onward.
Document selector = new Document();
int upsert = 0;
if(doc["_id"] != null){
selector["_id"] = doc["_id"];
}else{
//Likely a new document
upsert = 1;
}
this.Update(doc, selector, upsert);
}
public void Update(Document doc, Document selector){
this.Update(doc, selector, 0);
}
public void Update(Document doc, Document selector, int upsert){
UpdateMessage um = new UpdateMessage();
um.FullCollectionName = this.FullName;
um.Selector = BsonConvert.From(selector);
um.Document = BsonConvert.From(doc);
um.Upsert = upsert;
this.connection.SendMessage(um);
}
public void UpdateAll(Document doc, Document selector){
Cursor toUpdate = this.Find(selector);
foreach(Document udoc in toUpdate.Documents){
Document updSel = new Document();
updSel["_id"] = udoc["_id"];
udoc.Update(doc);
this.Update(udoc, updSel,0);
}
}
}
}
>>>>>>>
/*
* User: scorder
* Date: 7/8/2009
*/
using System;
using System.Collections.Generic;
using MongoDB.Driver.Bson;
using MongoDB.Driver.IO;
namespace MongoDB.Driver
{
/// <summary>
/// Description of Collection.
/// </summary>
public class Collection
{
private Connection connection;
private string name;
public string Name {
get { return name; }
}
private string dbName;
public string DbName {
get { return dbName; }
}
public string FullName{
get{ return dbName + "." + name;}
}
public Collection(string name, Connection conn, string dbName)
{
this.name = name;
this.connection = conn;
this.dbName = dbName;
}
public Document FindOne(Document spec){
Cursor cur = this.Find(spec, -1,0,null);
foreach(Document doc in cur.Documents){
cur.Dispose();
return doc;
}
//FIXME Decide if this should throw a not found exception instead of returning null.
return null; //this.Find(spec, -1, 0, null)[0];
}
public Cursor FindAll(){
Document spec = new Document();
return this.Find(spec, 0, 0, null);
}
public Cursor Find(Document spec){
return this.Find(spec, 0, 0, null);
}
public Cursor Find(Document spec, int limit, int skip){
return this.Find(spec, limit, skip, null);
}
public Cursor Find(Document spec, int limit, int skip, Document fields){
if(spec == null) spec = new Document();
Cursor cur = new Cursor(connection, this.FullName, spec, limit, skip, fields);
return cur;
}
public long Count(){
return this.Count(new Document());
}
public long Count(Document spec){
Database db = new Database(this.connection, this.dbName);
Collection cmd = db["$cmd"];
Document ret = cmd.FindOne(new Document().Append("count",this.Name).Append("query",spec));
if(ret.Contains("ok") && (double)ret["ok"] == 1){
double n = (double)ret["n"];
return Convert.ToInt64(n);
}else{
//FIXME This is an exception condition when the namespace is missing. -1 might be better here but the console returns 0.
return 0;
}
}
public void Insert(Document doc){
Document[] docs = new Document[]{doc,};
this.Insert(docs);
}
public void Insert(List<Document> docs){
this.Insert(docs.ToArray());
}
public void Insert(Document[] docs){
InsertMessage im = new InsertMessage();
im.FullCollectionName = this.FullName;
List<BsonDocument> bdocs = new List<BsonDocument>(docs.Length);
foreach(Document doc in docs){
bdocs.Add(BsonConvert.From(doc));
}
im.BsonDocuments = bdocs.ToArray();
this.connection.SendMessage(im);
}
public void Delete(Document selector){
DeleteMessage dm = new DeleteMessage();
dm.FullCollectionName = this.FullName;
dm.Selector = BsonConvert.From(selector);
this.connection.SendMessage(dm);
}
public void Update(Document doc){
//Try to generate a selector using _id for an existing document.
//otherwise just set the upsert flag to 1 to insert and send onward.
Document selector = new Document();
int upsert = 0;
if(doc["_id"] != null){
selector["_id"] = doc["_id"];
}else{
//Likely a new document
upsert = 1;
}
this.Update(doc, selector, upsert);
}
public void Update(Document doc, Document selector){
this.Update(doc, selector, 0);
}
public void Update(Document doc, Document selector, int upsert){
UpdateMessage um = new UpdateMessage();
um.FullCollectionName = this.FullName;
um.Selector = BsonConvert.From(selector);
um.Document = BsonConvert.From(doc);
um.Upsert = upsert;
this.connection.SendMessage(um);
}
public void UpdateAll(Document doc, Document selector){
Cursor toUpdate = this.Find(selector);
foreach(Document udoc in toUpdate.Documents){
Document updSel = new Document();
updSel["_id"] = udoc["_id"];
udoc.Update(doc);
this.Update(udoc, updSel,0);
}
}
}
} |
<<<<<<<
public void PrepareForLongRequest()
{
Timeout = TimeSpan.FromHours(6);
webRequest.AllowWriteStreamBuffering = false;
}
public Task<Stream> GetRawRequestStream()
{
return Task.Factory.FromAsync<Stream>(webRequest.BeginGetRequestStream, webRequest.EndGetRequestStream, null);
}
public Task<WebResponse> RawExecuteRequestAsync()
{
try
{
return webRequest.GetResponseAsync();
}
catch (WebException we)
{
var httpWebResponse = we.Response as HttpWebResponse;
if (httpWebResponse == null)
throw;
var sb = new StringBuilder()
.Append(httpWebResponse.StatusCode)
.Append(" ")
.Append(httpWebResponse.StatusDescription)
.AppendLine();
using (var reader = new StreamReader(httpWebResponse.GetResponseStream()))
{
string line;
while ((line = reader.ReadLine()) != null)
{
sb.AppendLine(line);
}
}
throw new InvalidOperationException(sb.ToString(), we);
}
}
=======
public Task<WebResponse> RawExecuteRequestAsync()
{
if (requestSendToServer)
throw new InvalidOperationException("Request was already sent to the server, cannot retry request.");
requestSendToServer = true;
return WaitForTask.ContinueWith(_ => webRequest
.GetResponseAsync()
.ConvertSecurityExceptionToServerNotFound()
.AddUrlIfFaulting(webRequest.RequestUri))
.Unwrap();
}
>>>>>>>
public void PrepareForLongRequest()
{
Timeout = TimeSpan.FromHours(6);
webRequest.AllowWriteStreamBuffering = false;
}
public Task<Stream> GetRawRequestStream()
{
return Task.Factory.FromAsync<Stream>(webRequest.BeginGetRequestStream, webRequest.EndGetRequestStream, null);
}
public Task<WebResponse> RawExecuteRequestAsync()
{
if (requestSendToServer)
throw new InvalidOperationException("Request was already sent to the server, cannot retry request.");
requestSendToServer = true;
return WaitForTask.ContinueWith(_ => webRequest
.GetResponseAsync()
.ConvertSecurityExceptionToServerNotFound()
.AddUrlIfFaulting(webRequest.RequestUri))
.Unwrap();
} |
<<<<<<<
Assert.NotEmpty(accessor.Lists.Read(Constants.RavenReplicationDocsTombstones, Etag.Empty, 10));
=======
Assert.NotEmpty(accessor.Lists.Read(Constants.RavenReplicationDocsTombstones, Guid.Empty, null, 10));
>>>>>>>
Assert.NotEmpty(accessor.Lists.Read(Constants.RavenReplicationDocsTombstones, Etag.Empty, null, 10));
<<<<<<<
Assert.Empty(accessor.Lists.Read(Constants.RavenReplicationDocsTombstones, Etag.Empty, 10).ToArray());
=======
Assert.Empty(accessor.Lists.Read(Constants.RavenReplicationDocsTombstones, Guid.Empty, null, 10));
>>>>>>>
Assert.Empty(accessor.Lists.Read(Constants.RavenReplicationDocsTombstones, Etag.Empty, null, 10).ToArray());
<<<<<<<
Assert.Equal(2, accessor.Lists.Read(Constants.RavenReplicationDocsTombstones, Etag.Empty, 10).Count());
=======
Assert.Equal(2, accessor.Lists.Read(Constants.RavenReplicationDocsTombstones, Guid.Empty, null, 10).Count());
>>>>>>>
Assert.Equal(2, accessor.Lists.Read(Constants.RavenReplicationDocsTombstones, Etag.Empty, null, 10).Count());
<<<<<<<
Assert.Equal(1, accessor.Lists.Read(Constants.RavenReplicationDocsTombstones, Etag.Empty, 10).Count());
=======
Assert.Equal(1, accessor.Lists.Read(Constants.RavenReplicationDocsTombstones, Guid.Empty, null, 10).Count());
>>>>>>>
Assert.Equal(1, accessor.Lists.Read(Constants.RavenReplicationDocsTombstones, Etag.Empty, null, 10).Count()); |
<<<<<<<
dataSection = new DocumentSection{ Name = "Data", Document = new EditorDocument { Language = JsonLanguage, TabSize = 2 } };
metaDataSection = new DocumentSection{ Name = "Metadata", Document = new EditorDocument { Language = JsonLanguage, TabSize = 2 } };
DocumentSections = new List<DocumentSection> { dataSection, metaDataSection };
EnableExpiration = new Observable<bool>();
=======
ApplicationModel.Current.Server.Value.RawUrl = null;
dataSection = new DocumentSection{ Name = "Data", Document = new EditorDocument { Language = JsonLanguage, TabSize = 2 } };
metaDataSection = new DocumentSection{ Name = "Metadata", Document = new EditorDocument { Language = JsonLanguage, TabSize = 2 } };
DocumentSections = new List<DocumentSection> { dataSection, metaDataSection };
EnableExpiration = new Observable<bool>();
ExpireAt = new Observable<DateTime>();
ExpireAt.PropertyChanged += (sender, args) => TimeChanged = true;
>>>>>>>
ApplicationModel.Current.Server.Value.RawUrl = null;
dataSection = new DocumentSection{ Name = "Data", Document = new EditorDocument { Language = JsonLanguage, TabSize = 2 } };
metaDataSection = new DocumentSection{ Name = "Metadata", Document = new EditorDocument { Language = JsonLanguage, TabSize = 2 } };
DocumentSections = new List<DocumentSection> { dataSection, metaDataSection };
EnableExpiration = new Observable<bool>();
ExpireAt = new Observable<DateTime>();
ExpireAt.PropertyChanged += (sender, args) => TimeChanged = true;
<<<<<<<
public Observable<bool> EnableExpiration { get; set; }
private bool hasExpiration;
public bool HasExpiration
{
get { return hasExpiration; }
}
public bool TimeChanged { get; set; }
private DateTime expireAt;
public DateTime ExpireAt
{
get { return expireAt; }
set
{
expireAt = value;
TimeChanged = true;
}
}
=======
public Observable<bool> EnableExpiration { get; set; }
private bool hasExpiration;
public bool HasExpiration
{
get { return hasExpiration; }
set { hasExpiration = value; OnPropertyChanged(() => HasExpiration); }
}
public bool TimeChanged { get; set; }
public Observable<DateTime> ExpireAt { get; set; }
>>>>>>>
public Observable<bool> EnableExpiration { get; set; }
private bool hasExpiration;
public bool HasExpiration
{
get { return hasExpiration; }
set { hasExpiration = value; OnPropertyChanged(() => HasExpiration); }
}
public bool TimeChanged { get; set; }
private DateTime expireAt;
public DateTime ExpireAt
{
get { return expireAt; }
set
{
expireAt = value;
TimeChanged = true;
}
}
<<<<<<<
var recentQueue = ApplicationModel.Current.Server.Value.SelectedDatabase.Value.RecentDocuments;
recentQueue.Add(result.Document.Key);
=======
AssertNoPropertyBeyondSize(result.Document.DataAsJson, 500 * 1000);
var recentQueue = ApplicationModel.Current.Server.Value.SelectedDatabase.Value.RecentDocuments;
ApplicationModel.Current.Server.Value.RawUrl = "databases/" +
ApplicationModel.Current.Server.Value.SelectedDatabase.Value.Name +
"/docs/" + result.Document.Key;
recentQueue.Add(result.Document.Key);
>>>>>>>
AssertNoPropertyBeyondSize(result.Document.DataAsJson, 500 * 1000);
var recentQueue = ApplicationModel.Current.Server.Value.SelectedDatabase.Value.RecentDocuments;
ApplicationModel.Current.Server.Value.RawUrl = "databases/" +
ApplicationModel.Current.Server.Value.SelectedDatabase.Value.Name +
"/docs/" + result.Document.Key;
recentQueue.Add(result.Document.Key);
<<<<<<<
if (HasExpiration)
{
var expiration = result.Document.Metadata["Raven-Expiration-Date"];
if (expiration != null)
{
ExpireAt = DateTime.Parse(expiration.ToString());
EnableExpiration.Value = true;
}
else
{
ExpireAt = DateTime.Now;
}
}
=======
var expiration = result.Document.Metadata["Raven-Expiration-Date"];
if (expiration != null)
{
ExpireAt.Value = DateTime.Parse(expiration.ToString());
EnableExpiration.Value = true;
HasExpiration = true;
}
else
{
HasExpiration = false;
}
>>>>>>>
var expiration = result.Document.Metadata["Raven-Expiration-Date"];
if (expiration != null)
{
ExpireAt.Value = DateTime.Parse(expiration.ToString());
EnableExpiration.Value = true;
HasExpiration = true;
}
else
{
HasExpiration = false;
}
if (HasExpiration)
{
var expiration = result.Document.Metadata["Raven-Expiration-Date"];
if (expiration != null)
{
ExpireAt = DateTime.Parse(expiration.ToString());
EnableExpiration.Value = true;
}
else
{
ExpireAt = DateTime.Now;
}
} |
<<<<<<<
=======
using Raven.Imports.Newtonsoft.Json;
using Raven.Imports.Newtonsoft.Json.Linq;
>>>>>>>
<<<<<<<
var includeCmd = new AddIncludesCommand(database, TransactionInformation, (etag, doc) => multiLoadResult.Includes.Add(doc), includes,
new HashSet<string>(ids));
foreach (var jsonDocument in multiLoadResult.Results)
{
includeCmd.Execute(jsonDocument);
}
=======
var includeCmd = new AddIncludesCommand(database, TransactionInformation, (etag, doc) => multiLoadResult.Includes.Add(doc), includes, new HashSet<string>(ids));
foreach (var jsonDocument in multiLoadResult.Results)
{
includeCmd.Execute(jsonDocument);
}
>>>>>>>
var includeCmd = new AddIncludesCommand(database, TransactionInformation, (etag, doc) => multiLoadResult.Includes.Add(doc), includes,
new HashSet<string>(ids));
foreach (var jsonDocument in multiLoadResult.Results)
{
includeCmd.Execute(jsonDocument);
} |
<<<<<<<
const int Input1SlotId = 0;
const int Input2SlotId = 1;
const int OutputSlotId = 2;
const string kInput1SlotName = "A";
const string kInput2SlotName = "B";
const string kOutputSlotName = "Out";
public enum MultiplyType
=======
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Multiply-Node"; }
}
protected override MethodInfo GetFunctionToConvert()
>>>>>>>
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Multiply-Node"; }
}
const int Input1SlotId = 0;
const int Input2SlotId = 1;
const int OutputSlotId = 2;
const string kInput1SlotName = "A";
const string kInput2SlotName = "B";
const string kOutputSlotName = "Out";
public enum MultiplyType |
<<<<<<<
using System;
namespace Raven.Bundles.UniqueConstraints
{
using System.Linq;
using System.Text;
using Abstractions.Data;
using Database.Plugins;
using Json.Linq;
using Raven.Database.Extensions;
public class UniqueConstraintsPutTrigger : AbstractPutTrigger
{
public override void AfterPut(string key, RavenJObject document, RavenJObject metadata, System.Guid etag, TransactionInformation transactionInformation)
{
if (key.StartsWith("Raven/"))
{
return;
}
var entityName = metadata.Value<string>(Constants.RavenEntityName) + "/";
var properties = metadata.Value<RavenJArray>(Constants.EnsureUniqueConstraints);
if (properties == null || properties.Length <= 0)
return;
var constraintMetaObject = new RavenJObject { { Constants.IsConstraintDocument, true } };
constraintMetaObject.EnsureSnapshot();
foreach (var property in properties)
{
var propName = ((RavenJValue)property).Value.ToString();
var uniqueValue = document.Value<string>(propName);
if(uniqueValue == null)
continue;
string documentName = "UniqueConstraints/" + entityName + propName + "/" +Util.EscapeUniqueValue(uniqueValue);
Database.Put(
documentName,
null,
RavenJObject.FromObject(new { RelatedId = key }),
(RavenJObject)constraintMetaObject.CreateSnapshot(),
transactionInformation);
}
}
public override VetoResult AllowPut(string key, RavenJObject document, RavenJObject metadata, TransactionInformation transactionInformation)
{
if (key.StartsWith("Raven/"))
{
return VetoResult.Allowed;
}
var entityName = metadata.Value<string>(Constants.RavenEntityName);
if (string.IsNullOrEmpty(entityName))
{
return VetoResult.Allowed;
}
entityName += "/";
var properties = metadata.Value<RavenJArray>(Constants.EnsureUniqueConstraints);
if (properties == null || properties.Length <= 0)
return VetoResult.Allowed;
var invalidFields = new StringBuilder();
foreach (var property in properties)
{
var propName = ((RavenJValue)property).Value.ToString();
var uniqueValue = document.Value<string>(propName);
if(uniqueValue == null)
continue;
var checkKey = "UniqueConstraints/" + entityName + propName + "/" +
Util.EscapeUniqueValue(uniqueValue);
var checkDoc = Database.Get(checkKey, transactionInformation);
if (checkDoc == null)
continue;
var checkId = checkDoc.DataAsJson.Value<string>("RelatedId");
if (checkId != key)
{
invalidFields.Append(property + ", ");
}
}
if (invalidFields.Length > 0)
{
invalidFields.Length = invalidFields.Length - 2;
return VetoResult.Deny("Ensure unique constraint violated for fields: " + invalidFields);
}
return VetoResult.Allowed;
}
public override void OnPut(string key, RavenJObject document, RavenJObject metadata, TransactionInformation transactionInformation)
{
if (key.StartsWith("Raven/"))
{
return;
}
var entityName = metadata.Value<string>(Constants.RavenEntityName) +"/";
var properties = metadata.Value<RavenJArray>(Constants.EnsureUniqueConstraints);
if (properties == null || properties.Length <= 0)
return;
var oldDoc = Database.Get(key, transactionInformation);
if (oldDoc == null)
{
return;
}
var oldJson = oldDoc.DataAsJson;
foreach (var property in metadata.Value<RavenJArray>(Constants.EnsureUniqueConstraints))
{
var propName = ((RavenJValue)property).Value.ToString();
// Handle Updates in the Constraint
var uniqueValue = oldJson.Value<string>(propName);
if(uniqueValue == null)
continue;
if (!uniqueValue.Equals(document.Value<string>(propName)))
{
Database.Delete(
"UniqueConstraints/" + entityName + propName + "/" + Util.EscapeUniqueValue(uniqueValue),
null, transactionInformation);
}
}
}
}
}
=======
using System.Collections.Generic;
namespace Raven.Bundles.UniqueConstraints
{
using System.Linq;
using System.Text;
using Abstractions.Data;
using Database.Plugins;
using Json.Linq;
public class UniqueConstraintsPutTrigger : AbstractPutTrigger
{
public override void AfterPut(string key, RavenJObject document, RavenJObject metadata, System.Guid etag, TransactionInformation transactionInformation)
{
if (key.StartsWith("Raven/"))
{
return;
}
var entityName = metadata.Value<string>(Constants.RavenEntityName) + "/";
var properties = metadata.Value<RavenJArray>(Constants.EnsureUniqueConstraints);
if (properties == null || !properties.Any())
return;
var constraintMetaObject = new RavenJObject { { Constants.IsConstraintDocument, true } };
foreach (var property in properties)
{
var propName = ((RavenJValue)property).Value.ToString();
var prop = document[propName];
IEnumerable<string> relatedKeys;
var prefix = "UniqueConstraints/" + entityName + property + "/";
if (prop is RavenJArray)
relatedKeys = ((RavenJArray) prop).Select(p => p.Value<string>());
else
relatedKeys = new[] {prop.Value<string>()};
foreach (var relatedKey in relatedKeys)
{
Database.Put(
prefix + relatedKey,
null,
RavenJObject.FromObject(new {RelatedId = key}),
constraintMetaObject,
transactionInformation);
}
}
}
public override VetoResult AllowPut(string key, RavenJObject document, RavenJObject metadata, TransactionInformation transactionInformation)
{
if (key.StartsWith("Raven/"))
{
return VetoResult.Allowed;
}
var entityName = metadata.Value<string>(Constants.RavenEntityName);
if (string.IsNullOrEmpty(entityName))
{
return VetoResult.Allowed;
}
entityName += "/";
var properties = metadata.Value<RavenJArray>(Constants.EnsureUniqueConstraints);
if (properties == null || properties.Length <= 0)
return VetoResult.Allowed;
var invalidFields = new StringBuilder();
foreach (var property in properties)
{
var propName = property.Value<string>();
IEnumerable<string> checkKeys;
var prefix = "UniqueConstraints/" + entityName + property + "/";
var prop = document[propName];
if (prop is RavenJArray)
checkKeys = ((RavenJArray)prop).Select(p => p.Value<string>());
else
checkKeys = new[] { prop.Value<string>() };
foreach (var checkKey in checkKeys)
{
var checkDoc = Database.Get(prefix + checkKey, transactionInformation);
if (checkDoc == null)
continue;
var checkId = checkDoc.DataAsJson.Value<string>("RelatedId");
if (checkId != key)
invalidFields.Append(property + ", ");
break;
}
}
if (invalidFields.Length > 0)
{
invalidFields.Length = invalidFields.Length - 2;
return VetoResult.Deny("Ensure unique constraint violated for fields: " + invalidFields);
}
return VetoResult.Allowed;
}
public override void OnPut(string key, RavenJObject document, RavenJObject metadata, TransactionInformation transactionInformation)
{
if (key.StartsWith("Raven/"))
return;
var entityName = metadata.Value<string>(Constants.RavenEntityName) +"/";
var properties = metadata.Value<RavenJArray>(Constants.EnsureUniqueConstraints);
if (properties == null || properties.Length <= 0)
return;
var oldDoc = Database.Get(key, transactionInformation);
if (oldDoc == null)
{
return;
}
var oldJson = oldDoc.DataAsJson;
foreach (var property in metadata.Value<RavenJArray>(Constants.EnsureUniqueConstraints))
{
var propName = ((RavenJValue)property).Value.ToString();
IEnumerable<string> deleteKeys;
if (oldJson.Value<string>(propName).Equals(document.Value<string>(propName))) continue;
// Handle Updates in the constraint since it changed
var prefix = "UniqueConstraints/" + entityName + property + "/";
var prop = document[propName];
if (prop is RavenJArray)
deleteKeys = ((RavenJArray)prop).Select(p => p.Value<string>());
else
deleteKeys = new[] { prop.Value<string>() };
foreach (var deleteKey in deleteKeys)
Database.Delete(prefix + deleteKey, null, transactionInformation);
}
}
}
}
>>>>>>>
using System.Collections.Generic;
using System;
namespace Raven.Bundles.UniqueConstraints
{
using System.Linq;
using System.Text;
using Abstractions.Data;
using Database.Plugins;
using Json.Linq;
using Raven.Database.Extensions;
public class UniqueConstraintsPutTrigger : AbstractPutTrigger
{
public override void AfterPut(string key, RavenJObject document, RavenJObject metadata, System.Guid etag, TransactionInformation transactionInformation)
{
if (key.StartsWith("Raven/"))
{
return;
}
var entityName = metadata.Value<string>(Constants.RavenEntityName) + "/";
var properties = metadata.Value<RavenJArray>(Constants.EnsureUniqueConstraints);
if (properties == null || properties.Count() <= 0)
if (properties == null || !properties.Any())
if (properties == null || properties.Length <= 0)
return;
var constraintMetaObject = new RavenJObject { { Constants.IsConstraintDocument, true } };
constraintMetaObject.EnsureSnapshot();
foreach (var property in properties)
{
var propName = ((RavenJValue)property).Value.ToString();
var prop = document[propName];
IEnumerable<string> relatedKeys;
var prefix = "UniqueConstraints/" + entityName + property + "/";
if (prop is RavenJArray)
relatedKeys = ((RavenJArray) prop).Select(p => p.Value<string>());
else
relatedKeys = new[] {prop.Value<string>()};
foreach (var relatedKey in relatedKeys)
{
var uniqueValue = document.Value<string>(propName);
if(uniqueValue == null)
continue;
string documentName = "UniqueConstraints/" + entityName + propName + "/" +Util.EscapeUniqueValue(uniqueValue);
Database.Put(
"UniqueConstraints/" + entityName + propName + "/" + document.Value<string>(propName),
prefix + relatedKey,
documentName,
null,
RavenJObject.FromObject(new {RelatedId = key}),
(RavenJObject)constraintMetaObject.CreateSnapshot(),
transactionInformation);
}
}
}
public override VetoResult AllowPut(string key, RavenJObject document, RavenJObject metadata, TransactionInformation transactionInformation)
{
if (key.StartsWith("Raven/"))
{
return VetoResult.Allowed;
}
var entityName = metadata.Value<string>(Constants.RavenEntityName);
if (string.IsNullOrEmpty(entityName))
{
return VetoResult.Allowed;
}
entityName += "/";
var properties = metadata.Value<RavenJArray>(Constants.EnsureUniqueConstraints);
if (properties == null || properties.Length <= 0)
return VetoResult.Allowed;
var invalidFields = new StringBuilder();
foreach (var property in properties)
{
var propName = ((RavenJValue)property).Value.ToString();
var checkKey = "UniqueConstraints/" + entityName + propName + "/" + document.Value<string>(propName);
var checkDoc = Database.Get(checkKey, transactionInformation);
var propName = property.Value<string>();
IEnumerable<string> checkKeys;
var prefix = "UniqueConstraints/" + entityName + property + "/";
var prop = document[propName];
if (prop is RavenJArray)
checkKeys = ((RavenJArray)prop).Select(p => p.Value<string>());
else
checkKeys = new[] { prop.Value<string>() };
foreach (var checkKey in checkKeys)
{
var checkDoc = Database.Get(prefix + checkKey, transactionInformation);
var propName = ((RavenJValue)property).Value.ToString();
var uniqueValue = document.Value<string>(propName);
if(uniqueValue == null)
continue;
var checkKey = "UniqueConstraints/" + entityName + propName + "/" +
Util.EscapeUniqueValue(uniqueValue);
var checkDoc = Database.Get(checkKey, transactionInformation);
if (checkDoc == null)
continue;
var checkId = checkDoc.DataAsJson.Value<string>("RelatedId");
if (checkId != key)
invalidFields.Append(property + ", ");
break;
}
}
if (invalidFields.Length > 0)
{
invalidFields.Length = invalidFields.Length - 2;
return VetoResult.Deny("Ensure unique constraint violated for fields: " + invalidFields);
}
return VetoResult.Allowed;
}
public override void OnPut(string key, RavenJObject document, RavenJObject metadata, TransactionInformation transactionInformation)
{
if (key.StartsWith("Raven/"))
return;
var entityName = metadata.Value<string>(Constants.RavenEntityName) +"/";
var properties = metadata.Value<RavenJArray>(Constants.EnsureUniqueConstraints);
if (properties == null || properties.Length <= 0)
return;
var oldDoc = Database.Get(key, transactionInformation);
if (oldDoc == null)
{
return;
}
var oldJson = oldDoc.DataAsJson;
foreach (var property in metadata.Value<RavenJArray>(Constants.EnsureUniqueConstraints))
{
var propName = ((RavenJValue)property).Value.ToString();
IEnumerable<string> deleteKeys;
// Handle Updates in the Constraint
if (!oldJson.Value<string>(propName).Equals(document.Value<string>(propName)))
{
Database.Delete("UniqueConstraints/" + entityName + propName + "/" + oldJson.Value<string>(propName), null, transactionInformation);
}
if (oldJson.Value<string>(propName).Equals(document.Value<string>(propName))) continue;
// Handle Updates in the constraint since it changed
var prefix = "UniqueConstraints/" + entityName + property + "/";
var prop = document[propName];
if (prop is RavenJArray)
deleteKeys = ((RavenJArray)prop).Select(p => p.Value<string>());
else
deleteKeys = new[] { prop.Value<string>() };
foreach (var deleteKey in deleteKeys)
Database.Delete(prefix + deleteKey, null, transactionInformation);
// Handle Updates in the Constraint
var uniqueValue = oldJson.Value<string>(propName);
if(uniqueValue == null)
continue;
if (!uniqueValue.Equals(document.Value<string>(propName)))
{
Database.Delete(
"UniqueConstraints/" + entityName + propName + "/" + Util.EscapeUniqueValue(uniqueValue),
null, transactionInformation);
}
}
}
}
} |
<<<<<<<
RemoveReservedProperties(metadata);
Etag newEtag = Etag.Empty;
=======
RemoveMetadataReservedProperties(metadata);
Guid newEtag = Guid.Empty;
>>>>>>>
RemoveMetadataReservedProperties(metadata);
Etag newEtag = Etag.Empty; |
<<<<<<<
JToken value;
=======
if (ReplicationContext.IsInReplicationContext)
return ReadVetoResult.Allowed;
RavenJToken value;
>>>>>>>
RavenJToken value; |
<<<<<<<
var value = StripQuotesIfNeeded(header.Value.ToString(Formatting.None));
switch (header.Name)
{
case "Content-Type":
context.Response.ContentType = value;
break;
default:
context.Response.AddHeader(header.Name, value);
break;
}
}
if (headers["@Http-Status-Code"] != null)
{
context.Response.StatusCode = headers.Value<int>("@Http-Status-Code");
context.Response.StatusDescription = headers.Value<string>("@Http-Status-Description");
=======
context.Response.Headers[header.Name] = WriteHeaderValue(header);
>>>>>>>
var value = WriteHeaderValue(header);
switch (header.Name)
{
case "Content-Type":
context.Response.ContentType = value;
break;
default:
context.Response.AddHeader(header.Name, value);
break;
}
}
if (headers["@Http-Status-Code"] != null)
{
context.Response.StatusCode = headers.Value<int>("@Http-Status-Code");
context.Response.StatusDescription = headers.Value<string>("@Http-Status-Description"); |
<<<<<<<
using System.Threading.Tasks;
using Raven.Client.Document;
=======
using Raven.Client.Extensions;
>>>>>>>
using Raven.Client.Document;
using Raven.Client.Extensions;
using Raven.Client.Extensions;
using System.Threading.Tasks;
using Raven.Client.Document;
<<<<<<<
using (GetNewServer())
using (var store = new DocumentStore {Url = "http://localhost:8079"}.Initialize())
=======
using(var store = NewRemoteDocumentStore())
>>>>>>>
using(var store = NewRemoteDocumentStore())
<<<<<<<
var result = queryResultAsync.Item2;
Assert.Equal("Ayende", result[0].Name);
=======
var result = queryResultAsync.Result;
Assert.Equal("Ayende",
result[0].Name);
>>>>>>>
var result = queryResultAsync.Item2;
Assert.Equal("Ayende", result[0].Name); |
<<<<<<<
var ravenQueryProvider = new RavenQueryProviderProcessor<T>(provider.QueryGenerator, null, null, null);
var luceneQuery = ravenQueryProvider.GetLuceneQueryFor(expression);
=======
var ravenQueryProvider = new RavenQueryProviderProcessor<T>(provider.QueryGenerator, null, null, null, new HashSet<string>());
ravenQueryProvider.ProcessExpression(expression);
>>>>>>>
var ravenQueryProvider = new RavenQueryProviderProcessor<T>(provider.QueryGenerator, null, null, null, new HashSet<string>());
var luceneQuery = ravenQueryProvider.GetLuceneQueryFor(expression);
<<<<<<<
var ravenQueryProvider = new RavenQueryProviderProcessor<T>(provider.QueryGenerator, null, null, indexName);
var luceneQuery = ravenQueryProvider.GetLuceneQueryFor(expression);
return ((IRavenQueryInspector)luceneQuery).IndexQueried;
=======
var ravenQueryProvider = new RavenQueryProviderProcessor<T>(provider.QueryGenerator, null, null, indexName, new HashSet<string>());
ravenQueryProvider.ProcessExpression(expression);
return ((IRavenQueryInspector)ravenQueryProvider.LuceneQuery).IndexQueried;
>>>>>>>
var ravenQueryProvider = new RavenQueryProviderProcessor<T>(provider.QueryGenerator, null, null, indexName, new HashSet<string>());
var luceneQuery = ravenQueryProvider.GetLuceneQueryFor(expression);
return ((IRavenQueryInspector)luceneQuery).IndexQueried;
<<<<<<<
var ravenQueryProvider = new RavenQueryProviderProcessor<T>(provider.QueryGenerator, null, null, null);
var luceneQuery = ravenQueryProvider.GetLuceneQueryFor(expression);
return ((IRavenQueryInspector)luceneQuery).GetLastEqualityTerm();
=======
var ravenQueryProvider = new RavenQueryProviderProcessor<T>(provider.QueryGenerator, null, null, null, new HashSet<string>());
ravenQueryProvider.ProcessExpression(expression);
return ((IRavenQueryInspector)ravenQueryProvider.LuceneQuery).GetLastEqualityTerm();
>>>>>>>
var ravenQueryProvider = new RavenQueryProviderProcessor<T>(provider.QueryGenerator, null, null, null, new HashSet<string>());
var luceneQuery = ravenQueryProvider.GetLuceneQueryFor(expression);
return ((IRavenQueryInspector)luceneQuery).GetLastEqualityTerm(); |
<<<<<<<
/// <summary>
/// Order the results by the specified fields
/// </summary>
/// <remarks>
/// The fields are the names of the fields to sort, defaulting to sorting by ascending.
/// You can prefix a field name with '-' to indicate sorting by descending or '+' to sort by ascending
/// </remarks>
/// <param name="fields">The fields.</param>
=======
IDocumentQuery<T> SortByDistance();
>>>>>>>
IDocumentQuery<T> SortByDistance();
/// <summary>
/// Order the results by the specified fields
/// </summary>
/// <remarks>
/// The fields are the names of the fields to sort, defaulting to sorting by ascending.
/// You can prefix a field name with '-' to indicate sorting by descending or '+' to sort by ascending
/// </remarks>
/// <param name="fields">The fields.</param> |
<<<<<<<
private readonly Dictionary<long, JournalFile.PagePosition> _transactionPageTranslation = new Dictionary<long, JournalFile.PagePosition>();
private ImmutableAppendOnlyList<KeyValuePair<long, long>> _transactionEndPositions = ImmutableAppendOnlyList<KeyValuePair<long, long>>.Empty;
=======
private int _recoveryPage;
private LinkedDictionary<long, JournalFile.PagePosition> _transactionPageTranslation = LinkedDictionary<long, JournalFile.PagePosition>.Empty;
>>>>>>>
private readonly Dictionary<long, JournalFile.PagePosition> _transactionPageTranslation = new Dictionary<long, JournalFile.PagePosition>();
private ImmutableAppendOnlyList<KeyValuePair<long, long>> _transactionEndPositions = ImmutableAppendOnlyList<KeyValuePair<long, long>>.Empty;
private int _recoveryPage;
private LinkedDictionary<long, JournalFile.PagePosition> _transactionPageTranslation = LinkedDictionary<long, JournalFile.PagePosition>.Empty;
<<<<<<<
var tempTransactionPageTranslaction = new Dictionary<long, JournalFile.PagePosition>();
=======
_recoveryPager.EnsureContinuous(null, _recoveryPage, (current->PageCount + current->OverflowPageCount) + 1);
var dataPage = _recoveryPager.GetWritable(_recoveryPage);
NativeMethods.memset(dataPage.Base, 0, (current->PageCount + current->OverflowPageCount) * AbstractPager.PageSize);
var compressedSize = Lz4.LZ4_uncompress(_pager.Read(_readingPage).Base, dataPage.Base, current->UncompressedSize);
if (compressedSize != current->CompressedSize) //Compression error. Probably file is corrupted
{
RequireHeaderUpdate = true;
return false;
}
>>>>>>>
_recoveryPager.EnsureContinuous(null, _recoveryPage, (current->PageCount + current->OverflowPageCount) + 1);
var dataPage = _recoveryPager.GetWritable(_recoveryPage);
NativeMethods.memset(dataPage.Base, 0, (current->PageCount + current->OverflowPageCount) * AbstractPager.PageSize);
var compressedSize = Lz4.LZ4_uncompress(_pager.Read(_readingPage).Base, dataPage.Base, current->UncompressedSize);
if (compressedSize != current->CompressedSize) //Compression error. Probably file is corrupted
{
RequireHeaderUpdate = true;
return false;
}
<<<<<<<
_transactionEndPositions = _transactionEndPositions.Append(new KeyValuePair<long, long>(current->TransactionId, _readingPage - 1));
=======
_transactionPageTranslation = _transactionPageTranslation.SetItems(transactionTable);
>>>>>>>
_transactionPageTranslation = _transactionPageTranslation.SetItems(transactionTable);
<<<<<<<
public ImmutableAppendOnlyList<KeyValuePair<long, long>> TransactionEndPositions
{
get { return _transactionEndPositions; }
}
=======
>>>>>>>
public ImmutableAppendOnlyList<KeyValuePair<long, long>> TransactionEndPositions
{
get { return _transactionEndPositions; }
} |
<<<<<<<
if (GenerateEntityIdOnTheClient.TryGetIdFromDynamic(entity, out id))
return id;
var key = await GenerateKeyAsync(entity);
// If we generated a new id, store it back into the Id field so the client has access to to it
if (key != null)
GenerateEntityIdOnTheClient.TrySetIdOnDynamic(entity, key);
return key;
=======
if (GenerateEntityIdOnTheClient.TryGetIdFromDynamic(entity, out id) || id == null)
return CompletedTask.With(id);
return GenerateKeyAsync(entity)
.ContinueWith(task =>
{
// If we generated a new id, store it back into the Id field so the client has access to to it
if (task.Result != null)
GenerateEntityIdOnTheClient.TrySetIdOnDynamic(entity, task.Result);
return task.Result;
});
>>>>>>>
if (GenerateEntityIdOnTheClient.TryGetIdFromDynamic(entity, out id) || id == null)
return CompletedTask.With(id);
var key = await GenerateKeyAsync(entity);
// If we generated a new id, store it back into the Id field so the client has access to to it
if (key != null)
GenerateEntityIdOnTheClient.TrySetIdOnDynamic(entity, key);
return key; |
<<<<<<<
ReduceKeyCounts = new Table(Tables.ReduceKeyCounts.TableName, Tables.ReduceKeyCounts.Indices.ByView);
ReduceKeyTypes = new Table(Tables.ReduceKeyTypes.TableName, Tables.ReduceKeyTypes.Indices.ByView);
Attachments = new Table(Tables.Attachments.TableName);
ReduceResults = new Table(Tables.ReduceResults.TableName);
=======
ReduceKeys = new Table(Tables.ReduceKeys.TableName, Tables.ReduceKeys.Indices.ByView);
Attachments = new Table(Tables.Attachments.TableName,Tables.Attachments.Indices.ByEtag);
>>>>>>>
ReduceKeyCounts = new Table(Tables.ReduceKeyCounts.TableName, Tables.ReduceKeyCounts.Indices.ByView);
ReduceKeyTypes = new Table(Tables.ReduceKeyTypes.TableName, Tables.ReduceKeyTypes.Indices.ByView);
Attachments = new Table(Tables.Attachments.TableName,Tables.Attachments.Indices.ByEtag);
ReduceResults = new Table(Tables.ReduceResults.TableName); |
<<<<<<<
using Raven.Abstractions.Data;
=======
using Raven.Abstractions.Connection;
>>>>>>>
using Raven.Abstractions.Connection;
using Raven.Abstractions.Data; |
<<<<<<<
IEnumerable<MappedResultInfo> GetMappedResults(string indexName, string[] keysToReduce, bool loadData);
IEnumerable<ReduceTypePerKey> GetReduceKeysAndTypes(string view, int start, int take);
=======
IEnumerable<MappedResultInfo> GetMappedResults(string indexName, IEnumerable<string> keysToReduce, bool loadData);
>>>>>>>
IEnumerable<MappedResultInfo> GetMappedResults(string indexName, IEnumerable<string> keysToReduce, bool loadData);
IEnumerable<ReduceTypePerKey> GetReduceKeysAndTypes(string view, int start, int take); |
<<<<<<<
public IEnumerable<ReduceTypePerKey> GetReduceKeysAndTypes(string view, int start, int take)
{
return storage.ReduceKeys["ByView"].SkipTo(new RavenJObject { { "view", view } })
.TakeWhile(x => StringComparer.InvariantCultureIgnoreCase.Equals(x.Value<string>("view"), view))
.Skip(start)
.Take(take)
.Select(token => new ReduceTypePerKey(token.Value<string>("reduceKey"), (ReduceType)token.Value<int>("reduceType")));
}
Dictionary<Tuple<string, string>, int> reduceKeyChanges;
private void IncrementReduceKeyCounter(string view, string reduceKey, int val)
{
if (reduceKeyChanges == null)
{
reduceKeyChanges = new Dictionary<Tuple<string, string>, int>();
}
var key = Tuple.Create(view, reduceKey);
reduceKeyChanges[key] = reduceKeyChanges.GetOrAdd(key) + val;
}
=======
>>>>>>> |
<<<<<<<
[Test]
public void TestToByteArray(){
byte[] bytes = new byte[]{1,2,3,4,5,6,7,8,9,10,11,12};
string hex = "0102030405060708090a0b0c";
Oid bval = new Oid(bytes);
byte[] bytes2 = bval.ToByteArray();
Assert.IsNotNull(bytes2);
Assert.AreEqual(12, bytes2.Length);
Assert.AreEqual(bytes, bytes2);
}
=======
[Test]
public void TestNewOidFromToString(){
var hex = "4B458B95D114BE541B000000";
var firstOid = new Oid(hex);
var secondOid = new Oid(firstOid.ToString());
Assert.AreEqual(firstOid.ToString(), secondOid.ToString());
}
>>>>>>>
[Test]
public void TestToByteArray(){
byte[] bytes = new byte[]{1,2,3,4,5,6,7,8,9,10,11,12};
string hex = "0102030405060708090a0b0c";
Oid bval = new Oid(bytes);
byte[] bytes2 = bval.ToByteArray();
Assert.IsNotNull(bytes2);
Assert.AreEqual(12, bytes2.Length);
Assert.AreEqual(bytes, bytes2);
}
[Test]
public void TestNewOidFromToString(){
var hex = "4B458B95D114BE541B000000";
var firstOid = new Oid(hex);
var secondOid = new Oid(firstOid.ToString());
Assert.AreEqual(firstOid.ToString(), secondOid.ToString());
} |
<<<<<<<
id = GenerateKey(entity);
=======
id = Conventions.DocumentKeyGenerator(entity);
// If we generated a new id, store it back into the Id field so the client has access to to it
>>>>>>>
id = GenerateKey(entity);
// If we generated a new id, store it back into the Id field so the client has access to to it
<<<<<<<
if (TryGetIdFromDynamic(entity, out id) == false)
{
return GenerateKeyAsync(entity)
=======
if (TryGetIdFromDynamic(entity, out id))
return CompletedTask.With(id);
else
return Conventions.AsyncDocumentKeyGenerator(entity)
>>>>>>>
if (TryGetIdFromDynamic(entity, out id))
return CompletedTask.With(id);
else
return GenerateKeyAsync(entity) |
<<<<<<<
// yeah, we found a line, let us give it to the users
var oldStartPos = startPos;
startPos = i + 1;
// is it an empty line?
if (oldStartPos == i - 2)
{
continue; // ignore and continue
}
// first 5 bytes should be: 'd','a','t','a',':'
// if it isn't, ignore and continue
if (buffer.Length - oldStartPos < 5 ||
buffer[oldStartPos] != 'd' ||
buffer[oldStartPos + 1] != 'a' ||
buffer[oldStartPos + 2] != 't' ||
buffer[oldStartPos + 3] != 'a' ||
buffer[oldStartPos + 4] != ':')
{
continue;
}
var data = Encoding.UTF8.GetString(buffer, oldStartPos + 5, i - 6);
=======
foundLines = true;
// yeah, we found a line, let us give it to the users
var data = Encoding.UTF8.GetString(buffer, startPos, i - 1 - startPos);
startPos = i + 1;
>>>>>>>
foundLines = true;
// yeah, we found a line, let us give it to the users
startPos = i + 1;
// is it an empty line?
if (oldStartPos == i - 2)
{
continue; // ignore and continue
}
// first 5 bytes should be: 'd','a','t','a',':'
// if it isn't, ignore and continue
if (buffer.Length - oldStartPos < 5 ||
buffer[oldStartPos] != 'd' ||
buffer[oldStartPos + 1] != 'a' ||
buffer[oldStartPos + 2] != 't' ||
buffer[oldStartPos + 3] != 'a' ||
buffer[oldStartPos + 4] != ':')
{
continue;
}
var data = Encoding.UTF8.GetString(buffer, oldStartPos + 5, i - 6); |
<<<<<<<
//-----------------------------------------------------------------------
// <copyright file="PendingTransactionRecovery.cs" company="Hibernating Rhinos LTD">
// Copyright (c) Hibernating Rhinos LTD. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.IO.IsolatedStorage;
using System.Transactions;
using Raven.Abstractions.Logging;
using Raven.Client.Connection;
using Raven.Abstractions.Extensions;
namespace Raven.Client.Document.DTC
{
public class PendingTransactionRecovery
{
private static readonly ILog logger = LogManager.GetCurrentClassLogger();
public void Execute(IDatabaseCommands commands)
{
var resourceManagersRequiringRecovery = new HashSet<Guid>();
using (var store = IsolatedStorageFile.GetMachineStoreForDomain())
{
foreach (var file in store.GetFileNames("*.recovery-information"))
{
var txId = Guid.Empty;
try
{
using (var fileStream = store.OpenFile(file, FileMode.Open, FileAccess.Read))
using(var reader = new BinaryReader(fileStream))
{
var resourceManagerId = new Guid(reader.ReadString());
txId = new Guid(reader.ReadString());
var db = reader.ReadString();
var dbCmds = string.IsNullOrEmpty(db) == false ?
commands.ForDatabase(db) :
commands.ForDefaultDatabase();
TransactionManager.Reenlist(resourceManagerId, fileStream.ReadData(), new InternalEnlistment(dbCmds, txId));
resourceManagersRequiringRecovery.Add(resourceManagerId);
logger.Info("Recovered transaction {0}", txId);
}
}
catch (Exception e)
{
logger.WarnException("Could not re-enlist in DTC transaction for tx: " + txId, e);
}
}
foreach (var rm in resourceManagersRequiringRecovery)
{
try
{
TransactionManager.RecoveryComplete(rm);
}
catch (Exception e)
{
logger.WarnException("Could not properly complete recovery of resource manager: " + rm, e);
}
}
var errors = new List<Exception>();
foreach (var file in store.GetFileNames("*.recovery-information"))
{
try
{
if (store.FileExists(file))
store.DeleteFile(file);
}
catch (Exception e)
{
errors.Add(e);
}
}
if (errors.Count > 0)
throw new AggregateException(errors);
}
}
public class InternalEnlistment : IEnlistmentNotification
{
private readonly IDatabaseCommands database;
private readonly Guid txId;
public InternalEnlistment(IDatabaseCommands database, Guid txId)
{
this.database = database;
this.txId = txId;
}
public void Prepare(PreparingEnlistment preparingEnlistment)
{
// shouldn't be called, already
// prepared, otherwise we won't have this issue
preparingEnlistment.Prepared();
}
public void Commit(Enlistment enlistment)
{
database.Commit(txId);
enlistment.Done();
}
public void Rollback(Enlistment enlistment)
{
database.Rollback(txId);
enlistment.Done();
}
public void InDoubt(Enlistment enlistment)
{
database.Rollback(txId);
enlistment.Done();
}
}
}
}
=======
//-----------------------------------------------------------------------
// <copyright file="PendingTransactionRecovery.cs" company="Hibernating Rhinos LTD">
// Copyright (c) Hibernating Rhinos LTD. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.IO.IsolatedStorage;
using System.Transactions;
using NLog;
using Raven.Client.Connection;
using Raven.Abstractions.Extensions;
namespace Raven.Client.Document.DTC
{
public class PendingTransactionRecovery
{
private static readonly Logger logger = LogManager.GetCurrentClassLogger();
public void Execute(Guid myResourceManagerId, IDatabaseCommands commands)
{
var resourceManagersRequiringRecovery = new HashSet<Guid>();
using (var store = IsolatedStorageFile.GetMachineStoreForDomain())
{
var filesToDelete = new List<string>();
foreach (var file in store.GetFileNames("*.recovery-information"))
{
var txId = Guid.Empty;
try
{
IsolatedStorageFileStream stream;
try
{
stream = store.OpenFile(file, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
}
catch (Exception e)
{
logger.WarnException("Could not open recovery information: " + file +", this is expected if it is an active transaction / held by another server", e);
continue;
}
using (stream)
using(var reader = new BinaryReader(stream))
{
var resourceManagerId = new Guid(reader.ReadString());
if(myResourceManagerId != resourceManagerId)
continue; // it doesn't belong to us, ignore
filesToDelete.Add(file);
txId = new Guid(reader.ReadString());
var db = reader.ReadString();
var dbCmds = string.IsNullOrEmpty(db) == false ?
commands.ForDatabase(db) :
commands.ForDefaultDatabase();
TransactionManager.Reenlist(resourceManagerId, stream.ReadData(), new InternalEnlistment(dbCmds, txId));
resourceManagersRequiringRecovery.Add(resourceManagerId);
logger.Info("Recovered transaction {0}", txId);
}
}
catch (Exception e)
{
logger.WarnException("Could not re-enlist in DTC transaction for tx: " + txId, e);
}
}
foreach (var rm in resourceManagersRequiringRecovery)
{
try
{
TransactionManager.RecoveryComplete(rm);
}
catch (Exception e)
{
logger.WarnException("Could not properly complete recovery of resource manager: " + rm, e);
}
}
var errors = new List<Exception>();
foreach (var file in filesToDelete)
{
try
{
if (store.FileExists(file))
store.DeleteFile(file);
}
catch (Exception e)
{
errors.Add(e);
}
}
if (errors.Count > 0)
throw new AggregateException(errors);
}
}
public class InternalEnlistment : IEnlistmentNotification
{
private readonly IDatabaseCommands database;
private readonly Guid txId;
public InternalEnlistment(IDatabaseCommands database, Guid txId)
{
this.database = database;
this.txId = txId;
}
public void Prepare(PreparingEnlistment preparingEnlistment)
{
// shouldn't be called, already
// prepared, otherwise we won't have this issue
preparingEnlistment.Prepared();
}
public void Commit(Enlistment enlistment)
{
database.Commit(txId);
enlistment.Done();
}
public void Rollback(Enlistment enlistment)
{
database.Rollback(txId);
enlistment.Done();
}
public void InDoubt(Enlistment enlistment)
{
database.Rollback(txId);
enlistment.Done();
}
}
}
}
>>>>>>>
//-----------------------------------------------------------------------
// <copyright file="PendingTransactionRecovery.cs" company="Hibernating Rhinos LTD">
// Copyright (c) Hibernating Rhinos LTD. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.IO.IsolatedStorage;
using System.Transactions;
using Raven.Abstractions.Logging;
using Raven.Client.Connection;
using Raven.Abstractions.Extensions;
namespace Raven.Client.Document.DTC
{
public class PendingTransactionRecovery
{
private static readonly ILog logger = LogManager.GetCurrentClassLogger();
public void Execute(Guid myResourceManagerId, IDatabaseCommands commands)
{
var resourceManagersRequiringRecovery = new HashSet<Guid>();
using (var store = IsolatedStorageFile.GetMachineStoreForDomain())
{
var filesToDelete = new List<string>();
foreach (var file in store.GetFileNames("*.recovery-information"))
{
var txId = Guid.Empty;
try
{
IsolatedStorageFileStream stream;
try
{
stream = store.OpenFile(file, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
}
catch (Exception e)
{
logger.WarnException("Could not open recovery information: " + file +", this is expected if it is an active transaction / held by another server", e);
continue;
}
using (stream)
using(var reader = new BinaryReader(stream))
{
var resourceManagerId = new Guid(reader.ReadString());
if(myResourceManagerId != resourceManagerId)
continue; // it doesn't belong to us, ignore
filesToDelete.Add(file);
txId = new Guid(reader.ReadString());
var db = reader.ReadString();
var dbCmds = string.IsNullOrEmpty(db) == false ?
commands.ForDatabase(db) :
commands.ForDefaultDatabase();
TransactionManager.Reenlist(resourceManagerId, stream.ReadData(), new InternalEnlistment(dbCmds, txId));
resourceManagersRequiringRecovery.Add(resourceManagerId);
logger.Info("Recovered transaction {0}", txId);
}
}
catch (Exception e)
{
logger.WarnException("Could not re-enlist in DTC transaction for tx: " + txId, e);
}
}
foreach (var rm in resourceManagersRequiringRecovery)
{
try
{
TransactionManager.RecoveryComplete(rm);
}
catch (Exception e)
{
logger.WarnException("Could not properly complete recovery of resource manager: " + rm, e);
}
}
var errors = new List<Exception>();
foreach (var file in filesToDelete)
{
try
{
if (store.FileExists(file))
store.DeleteFile(file);
}
catch (Exception e)
{
errors.Add(e);
}
}
if (errors.Count > 0)
throw new AggregateException(errors);
}
}
public class InternalEnlistment : IEnlistmentNotification
{
private readonly IDatabaseCommands database;
private readonly Guid txId;
public InternalEnlistment(IDatabaseCommands database, Guid txId)
{
this.database = database;
this.txId = txId;
}
public void Prepare(PreparingEnlistment preparingEnlistment)
{
// shouldn't be called, already
// prepared, otherwise we won't have this issue
preparingEnlistment.Prepared();
}
public void Commit(Enlistment enlistment)
{
database.Commit(txId);
enlistment.Done();
}
public void Rollback(Enlistment enlistment)
{
database.Rollback(txId);
enlistment.Done();
}
public void InDoubt(Enlistment enlistment)
{
database.Rollback(txId);
enlistment.Done();
}
}
}
} |
<<<<<<<
using System.Threading;
using System.Threading.Tasks;
=======
using System.Collections.Generic;
using System.Linq;
>>>>>>>
using System.Collections.Generic;
using System.Linq;
<<<<<<<
using Raven.Database.Extensions;
=======
using Raven.Client.Extensions;
using Raven.Client.Shard;
>>>>>>>
using Raven.Client.Shard;
<<<<<<<
var allCompanies = (await session.Advanced.AsyncLuceneQuery<Company>()
.WaitForNonStaleResults()
.ToListAsync()).Item2;
=======
var allCompanies = session.Advanced.AsyncLuceneQuery<Company>()
.WaitForNonStaleResults()
.ToListAsync().Result;
>>>>>>>
var allCompanies = (await session.Advanced.AsyncLuceneQuery<Company>()
.WaitForNonStaleResults()
.ToListAsync().Result; |
<<<<<<<
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
=======
using System;
using System.IO;
>>>>>>>
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO; |
<<<<<<<
var bwriter = new BsonWriter(bstream);
Header.MessageLength += CalculateBodySize(bwriter);
=======
var bwriter = new BsonWriter(bstream,new ReflectionDescriptor());
Header.MessageLength += this.CalculateBodySize(bwriter);
if(Header.MessageLength > MessageBase.MaximumMessageSize){
throw new MongoException("Maximum message length exceeded");
}
>>>>>>>
var bwriter = new BsonWriter(bstream);
Header.MessageLength += this.CalculateBodySize(bwriter);
if(Header.MessageLength > MessageBase.MaximumMessageSize){
throw new MongoException("Maximum message length exceeded");
} |
<<<<<<<
using Newtonsoft.Json.Linq;
using Raven.Abstractions.MEF;
=======
using Raven.Json.Linq;
>>>>>>>
using Raven.Json.Linq;
using Raven.Abstractions.MEF; |
<<<<<<<
var genericEnumerable = typeof(IEnumerable<>).MakeGenericType(child.AsType());
=======
if (child.IsGenericTypeDefinition)
continue;
var genericEnumerable = typeof(IEnumerable<>).MakeGenericType(child);
>>>>>>>
if (child.IsGenericTypeDefinition)
continue;
var genericEnumerable = typeof(IEnumerable<>).MakeGenericType(child.AsType()); |
<<<<<<<
#if SILVERLIGHT
/// <summary>
/// Get the low level bulk insert operation
/// </summary>
public ILowLevelBulkInsertOperation GetBulkInsertOperation(BulkInsertOptions options)
{
return new RemoteBulkInsertOperation(options, this);
}
#endif
=======
public async Task<IAsyncEnumerator<RavenJObject>> StreamQueryAsync(string index, IndexQuery query, Reference<QueryHeaderInformation> queryHeaderInfo)
{
EnsureIsNotNullOrEmpty(index, "index");
string path = query.GetIndexQueryUrl(url, index, "streams/query", includePageSizeEvenIfNotExplicitlySet: false);
var request = jsonRequestFactory.CreateHttpJsonRequest(
new CreateHttpJsonRequestParams(this, path, "GET", credentials, convention)
.AddOperationHeaders(OperationsHeaders))
.AddReplicationStatusHeaders(Url, url, replicationInformer,
convention.FailoverBehavior,
HandleReplicationStatusChanges);
var webResponse = await request.RawExecuteRequestAsync();
queryHeaderInfo.Value = new QueryHeaderInformation
{
Index = webResponse.Headers["Raven-Index"],
IndexTimestamp = DateTime.ParseExact(webResponse.Headers["Raven-Index-Timestamp"], Default.DateTimeFormatsToRead,
CultureInfo.InvariantCulture, DateTimeStyles.None),
IndexEtag = Etag.Parse(webResponse.Headers["Raven-Index-Etag"]),
ResultEtag = Etag.Parse(webResponse.Headers["Raven-Result-Etag"]),
IsStable = bool.Parse(webResponse.Headers["Raven-Is-Stale"]),
TotalResults = int.Parse(webResponse.Headers["Raven-Total-Results"])
};
return new YieldStreamResults(webResponse);
}
public class YieldStreamResults : IAsyncEnumerator<RavenJObject>
{
private readonly WebResponse webResponse;
private readonly Stream stream;
private readonly StreamReader streamReader;
private readonly JsonTextReaderAsync reader;
private bool wasInitalized;
public YieldStreamResults(WebResponse webResponse)
{
this.webResponse = webResponse;
stream = webResponse.GetResponseStreamWithHttpDecompression();
streamReader = new StreamReader(stream);
reader = new JsonTextReaderAsync(streamReader);
}
private async Task InitAsync()
{
if (await reader.ReadAsync() == false || reader.TokenType != JsonToken.StartObject)
throw new InvalidOperationException("Unexpected data at start of stream");
if (await reader.ReadAsync() == false || reader.TokenType != JsonToken.PropertyName || Equals("Results", reader.Value) == false)
throw new InvalidOperationException("Unexpected data at stream 'Results' property name");
if (await reader.ReadAsync() == false || reader.TokenType != JsonToken.StartArray)
throw new InvalidOperationException("Unexpected data at 'Results', could not find start results array");
}
public void Dispose()
{
reader.Close();
streamReader.Close();
stream.Close();
webResponse.Close();
}
public async Task<bool> MoveNextAsync()
{
if (wasInitalized == false)
{
await InitAsync();
wasInitalized = true;
}
if (await reader.ReadAsync() == false)
throw new InvalidOperationException("Unexpected end of data");
if (reader.TokenType == JsonToken.EndArray)
return false;
Current = (RavenJObject) await RavenJToken.ReadFromAsync(reader);
return true;
}
public RavenJObject Current { get; private set; }
}
public async Task<IAsyncEnumerator<RavenJObject>> StreamDocsAsync(Etag fromEtag = null, string startsWith = null, string matches = null, int start = 0,
int pageSize = Int32.MaxValue)
{
if (fromEtag != null && startsWith != null)
throw new InvalidOperationException("Either fromEtag or startsWith must be null, you can't specify both");
var sb = new StringBuilder(url).Append("/streams/docs?");
if (fromEtag != null)
{
sb.Append("etag=")
.Append(fromEtag)
.Append("&");
}
else
{
if (startsWith != null)
{
sb.Append("startsWith=").Append(Uri.EscapeDataString(startsWith)).Append("&");
}
if (matches != null)
{
sb.Append("matches=").Append(Uri.EscapeDataString(matches)).Append("&");
}
}
if (start != 0)
sb.Append("start=").Append(start).Append("&");
if (pageSize != int.MaxValue)
sb.Append("start=").Append(pageSize).Append("&");
var request = jsonRequestFactory.CreateHttpJsonRequest(
new CreateHttpJsonRequestParams(this, sb.ToString(), "GET", credentials, convention)
.AddOperationHeaders(OperationsHeaders))
.AddReplicationStatusHeaders(Url, url, replicationInformer, convention.FailoverBehavior, HandleReplicationStatusChanges);
var webResponse = await request.RawExecuteRequestAsync();
return new YieldStreamResults(webResponse);
}
>>>>>>>
public async Task<IAsyncEnumerator<RavenJObject>> StreamQueryAsync(string index, IndexQuery query, Reference<QueryHeaderInformation> queryHeaderInfo)
{
EnsureIsNotNullOrEmpty(index, "index");
string path = query.GetIndexQueryUrl(url, index, "streams/query", includePageSizeEvenIfNotExplicitlySet: false);
var request = jsonRequestFactory.CreateHttpJsonRequest(
new CreateHttpJsonRequestParams(this, path, "GET", credentials, convention)
.AddOperationHeaders(OperationsHeaders))
.AddReplicationStatusHeaders(Url, url, replicationInformer,
convention.FailoverBehavior,
HandleReplicationStatusChanges);
var webResponse = await request.RawExecuteRequestAsync();
queryHeaderInfo.Value = new QueryHeaderInformation
{
Index = webResponse.Headers["Raven-Index"],
IndexTimestamp = DateTime.ParseExact(webResponse.Headers["Raven-Index-Timestamp"], Default.DateTimeFormatsToRead,
CultureInfo.InvariantCulture, DateTimeStyles.None),
IndexEtag = Etag.Parse(webResponse.Headers["Raven-Index-Etag"]),
ResultEtag = Etag.Parse(webResponse.Headers["Raven-Result-Etag"]),
IsStable = bool.Parse(webResponse.Headers["Raven-Is-Stale"]),
TotalResults = int.Parse(webResponse.Headers["Raven-Total-Results"])
};
return new YieldStreamResults(webResponse);
}
public class YieldStreamResults : IAsyncEnumerator<RavenJObject>
{
private readonly WebResponse webResponse;
private readonly Stream stream;
private readonly StreamReader streamReader;
private readonly JsonTextReaderAsync reader;
private bool wasInitalized;
public YieldStreamResults(WebResponse webResponse)
{
this.webResponse = webResponse;
stream = webResponse.GetResponseStreamWithHttpDecompression();
streamReader = new StreamReader(stream);
reader = new JsonTextReaderAsync(streamReader);
}
private async Task InitAsync()
{
if (await reader.ReadAsync() == false || reader.TokenType != JsonToken.StartObject)
throw new InvalidOperationException("Unexpected data at start of stream");
if (await reader.ReadAsync() == false || reader.TokenType != JsonToken.PropertyName || Equals("Results", reader.Value) == false)
throw new InvalidOperationException("Unexpected data at stream 'Results' property name");
if (await reader.ReadAsync() == false || reader.TokenType != JsonToken.StartArray)
throw new InvalidOperationException("Unexpected data at 'Results', could not find start results array");
}
public void Dispose()
{
reader.Close();
streamReader.Close();
stream.Close();
webResponse.Close();
}
public async Task<bool> MoveNextAsync()
{
if (wasInitalized == false)
{
await InitAsync();
wasInitalized = true;
}
if (await reader.ReadAsync() == false)
throw new InvalidOperationException("Unexpected end of data");
if (reader.TokenType == JsonToken.EndArray)
return false;
Current = (RavenJObject) await RavenJToken.ReadFromAsync(reader);
return true;
}
public RavenJObject Current { get; private set; }
}
public async Task<IAsyncEnumerator<RavenJObject>> StreamDocsAsync(Etag fromEtag = null, string startsWith = null, string matches = null, int start = 0,
int pageSize = Int32.MaxValue)
{
if (fromEtag != null && startsWith != null)
throw new InvalidOperationException("Either fromEtag or startsWith must be null, you can't specify both");
var sb = new StringBuilder(url).Append("/streams/docs?");
if (fromEtag != null)
{
sb.Append("etag=")
.Append(fromEtag)
.Append("&");
}
else
{
if (startsWith != null)
{
sb.Append("startsWith=").Append(Uri.EscapeDataString(startsWith)).Append("&");
}
if (matches != null)
{
sb.Append("matches=").Append(Uri.EscapeDataString(matches)).Append("&");
}
}
if (start != 0)
sb.Append("start=").Append(start).Append("&");
if (pageSize != int.MaxValue)
sb.Append("start=").Append(pageSize).Append("&");
var request = jsonRequestFactory.CreateHttpJsonRequest(
new CreateHttpJsonRequestParams(this, sb.ToString(), "GET", credentials, convention)
.AddOperationHeaders(OperationsHeaders))
.AddReplicationStatusHeaders(Url, url, replicationInformer, convention.FailoverBehavior, HandleReplicationStatusChanges);
var webResponse = await request.RawExecuteRequestAsync();
return new YieldStreamResults(webResponse);
}
#if SILVERLIGHT
/// <summary>
/// Get the low level bulk insert operation
/// </summary>
public ILowLevelBulkInsertOperation GetBulkInsertOperation(BulkInsertOptions options)
{
return new RemoteBulkInsertOperation(options, this);
}
#endif |
<<<<<<<
var request =
jsonRequestFactory.CreateHttpJsonRequest(new CreateHttpJsonRequestParams(this, path.NoCache(), "GET", credentials,
convention)
=======
var request = jsonRequestFactory.CreateHttpJsonRequest(
new CreateHttpJsonRequestParams(this, path.NoCache(), "GET", credentials, convention)
>>>>>>>
var request = jsonRequestFactory.CreateHttpJsonRequest(
new CreateHttpJsonRequestParams(this, path.NoCache(), "GET", credentials, convention)
<<<<<<<
#region IAsyncAdminDatabaseCommands
public IAsyncAdminDatabaseCommands Admin
{
get { return this; }
}
Task<AdminStatistics> IAsyncAdminDatabaseCommands.GetStatisticsAsync()
{
return url.AdminStats()
.NoCache()
.ToJsonRequest(this, credentials, convention)
.ReadResponseJsonAsync()
.ContinueWith(task =>
{
var jo = ((RavenJObject)task.Result);
return jo.Deserialize<AdminStatistics>(convention);
});
}
#endregion
=======
public Task<RavenJToken> GetOperationStatusAsync(long id)
{
var request = jsonRequestFactory
.CreateHttpJsonRequest(new CreateHttpJsonRequestParams(this, url + "/operation/status?id=" + id, "GET", credentials, convention)
.AddOperationHeaders(OperationsHeaders));
return
request
.ReadResponseJsonAsync()
.ContinueWith(task => task.Result);
}
>>>>>>>
public Task<RavenJToken> GetOperationStatusAsync(long id)
{
var request = jsonRequestFactory
.CreateHttpJsonRequest(new CreateHttpJsonRequestParams(this, url + "/operation/status?id=" + id, "GET", credentials, convention)
.AddOperationHeaders(OperationsHeaders));
return
request
.ReadResponseJsonAsync()
.ContinueWith(task => task.Result);
}
#region IAsyncAdminDatabaseCommands
public IAsyncAdminDatabaseCommands Admin
{
get { return this; }
}
Task<AdminStatistics> IAsyncAdminDatabaseCommands.GetStatisticsAsync()
{
return url.AdminStats()
.NoCache()
.ToJsonRequest(this, credentials, convention)
.ReadResponseJsonAsync()
.ContinueWith(task =>
{
var jo = ((RavenJObject)task.Result);
return jo.Deserialize<AdminStatistics>(convention);
});
}
#endregion |
<<<<<<<
=======
UseSsl =
new BooleanSetting(settings["Raven/UseSsl"], false);
>>>>>>>
UseSsl =
new BooleanSetting(settings["Raven/UseSsl"], false);
<<<<<<<
=======
public BooleanSetting UseSsl { get; private set; }
>>>>>>>
public BooleanSetting UseSsl { get; private set; }
public StringSetting SslCertificatePath { get; private set; }
public StringSetting SslCertificatePassword { get; private set; }
public BooleanSetting UseSsl { get; private set; } |
<<<<<<<
var result = session.Advanced.LuceneQuery<EntityCount>("someIndex")
=======
var result = session.LuceneQuery<EntityCount>("someIndex").WaitForNonStaleResults()
>>>>>>>
var result = session.Advanced.LuceneQuery<EntityCount>("someIndex")
var result = session.LuceneQuery<EntityCount>("someIndex").WaitForNonStaleResults()
<<<<<<<
//doesn't matter what the query is here, just want to see if it's stale or not
session.Advanced.LuceneQuery<object>(indexName)
.Where("")
=======
session.LuceneQuery<object>(indexName)
.Where("NOT \"*\"")
>>>>>>>
session.Advanced.LuceneQuery<object>(indexName)
.Where("NOT \"*\"") |
<<<<<<<
var existingIndex = IndexDefinitionStorage.GetIndexDefinition(name);
=======
var fixedName = IndexDefinitionStorage.FixupIndexName(name);
var existingIndex = IndexDefinitionStorage.GetIndexDefinition(fixedName);
>>>>>>>
var fixedName = IndexDefinitionStorage.FixupIndexName(name);
var existingIndex = IndexDefinitionStorage.GetIndexDefinition(fixedName);
<<<<<<<
new DynamicViewCompiler(definition.Name, definition, Extensions, IndexDefinitionStorage.IndexDefinitionsPath, Configuration).GenerateInstance();
=======
new DynamicViewCompiler(fixedName, definition, Extensions, IndexDefinitionStorage.IndexDefinitionsPath, Configuration).GenerateInstance();
>>>>>>>
new DynamicViewCompiler(definition.Name, definition, Extensions, IndexDefinitionStorage.IndexDefinitionsPath, Configuration).GenerateInstance();
<<<<<<<
actions.Indexing.AddIndex(definition.IndexId, definition.IsMapReduce);
=======
actions.Indexing.AddIndex(fixedName, definition.IsMapReduce);
>>>>>>>
actions.Indexing.AddIndex(definition.IndexId, definition.IsMapReduce);
<<<<<<<
indexName = indexName != null ? indexName.Trim() : null;
=======
var fixedName = IndexDefinitionStorage.FixupIndexName(index);
>>>>>>>
indexName = indexName != null ? indexName.Trim() : null;
<<<<<<<
var viewGenerator = IndexDefinitionStorage.GetViewGenerator(indexName);
var index = IndexDefinitionStorage.GetIndexDefinition(indexName);
=======
var viewGenerator = IndexDefinitionStorage.GetViewGenerator(fixedName);
>>>>>>>
var viewGenerator = IndexDefinitionStorage.GetViewGenerator(indexName);
var index = IndexDefinitionStorage.GetIndexDefinition(indexName);
<<<<<<<
var indexInstance = IndexStorage.GetIndexInstance(indexName);
=======
var indexInstance = IndexStorage.GetIndexInstance(fixedName);
>>>>>>>
var indexInstance = IndexStorage.GetIndexInstance(indexName);
<<<<<<<
indexTimestamp = actions.Staleness.IndexLastUpdatedAt(index.IndexId);
var indexFailureInformation = actions.Indexing.GetFailureRate(index.IndexId);
=======
indexTimestamp = actions.Staleness.IndexLastUpdatedAt(fixedName);
var indexFailureInformation = actions.Indexing.GetFailureRate(fixedName);
>>>>>>>
indexTimestamp = actions.Staleness.IndexLastUpdatedAt(index.IndexId);
var indexFailureInformation = actions.Indexing.GetFailureRate(index.IndexId);
<<<<<<<
=======
var indexDefinition = GetIndexDefinition(fixedName);
>>>>>>>
<<<<<<<
result => docRetriever.ShouldIncludeResultInQuery(result, index, fieldsToFetch);
var indexQueryResults = IndexStorage.Query(indexName, query, shouldIncludeInResults, fieldsToFetch, IndexQueryTriggers);
=======
result => docRetriever.ShouldIncludeResultInQuery(result, indexDefinition, fieldsToFetch);
var indexQueryResults = IndexStorage.Query(fixedName, query, shouldIncludeInResults, fieldsToFetch, IndexQueryTriggers);
>>>>>>>
result => docRetriever.ShouldIncludeResultInQuery(result, index, fieldsToFetch);
var indexQueryResults = IndexStorage.Query(indexName, query, shouldIncludeInResults, fieldsToFetch, IndexQueryTriggers);
<<<<<<<
var instance = IndexDefinitionStorage.GetIndexDefinition(name);
if (instance == null) return;
IndexDefinitionStorage.RemoveIndex(name);
IndexStorage.DeleteIndex(name);
=======
var fixedName = IndexDefinitionStorage.FixupIndexName(name);
IndexDefinitionStorage.RemoveIndex(fixedName);
IndexStorage.DeleteIndex(fixedName);
>>>>>>>
var instance = IndexDefinitionStorage.GetIndexDefinition(name);
if (instance == null) return;
IndexDefinitionStorage.RemoveIndex(name);
IndexStorage.DeleteIndex(name);
<<<<<<<
action.Indexing.DeleteIndex(instance.IndexId);
=======
action.Indexing.DeleteIndex(fixedName);
>>>>>>>
action.Indexing.DeleteIndex(instance.IndexId);
<<<<<<<
var indexInstance = IndexStorage.GetIndexInstance(indexName);
if (indexInstance == null)
return;
isStale = (indexInstance.IsMapIndexingInProgress) ||
accessor.Staleness.IsIndexStale(indexInstance.indexId, null, null);
=======
var indexInstance = IndexStorage.GetIndexInstance(fixedName);
isStale = (indexInstance != null && indexInstance.IsMapIndexingInProgress) ||
accessor.Staleness.IsIndexStale(fixedName, null, null);
>>>>>>>
var indexInstance = IndexStorage.GetIndexInstance(fixedName);
if (indexInstance == null)
return;
isStale = (indexInstance.IsMapIndexingInProgress) ||
accessor.Staleness.IsIndexStale(indexInstance.indexId, null, null);
<<<<<<<
var indexStats = accessor.Indexing.GetIndexStats(indexInstance.indexId);
=======
var indexStats = accessor.Indexing.GetIndexStats(fixedName);
>>>>>>>
var indexStats = accessor.Indexing.GetIndexStats(indexInstance.indexId); |
<<<<<<<
public void Write (Stream stream){
MessageHeader header = this.Header;
BufferedStream bstream = new BufferedStream(stream);
BinaryWriter writer = new BinaryWriter(bstream);
BsonWriter bwriter = new BsonWriter(bstream);
Header.MessageLength += this.CalculateBodySize(bwriter);
if(Header.MessageLength > MessageBase.MaximumMessageSize){
throw new MongoException("Maximum message length exceeded");
}
=======
public void Write(Stream stream){
var header = Header;
var bstream = new BufferedStream(stream);
var writer = new BinaryWriter(bstream);
var bwriter = new BsonWriter(bstream,new ReflectionDescriptor());
Header.MessageLength += CalculateBodySize(bwriter);
>>>>>>>
public void Write (Stream stream){
var header = Header;
var bstream = new BufferedStream(stream);
var writer = new BinaryWriter(bstream);
var bwriter = new BsonWriter(bstream,new ReflectionDescriptor());
Header.MessageLength += this.CalculateBodySize(bwriter);
if(Header.MessageLength > MessageBase.MaximumMessageSize){
throw new MongoException("Maximum message length exceeded");
} |
<<<<<<<
#if !SILVERLIGHT && !NETFX_CORE
public Action<HttpWebRequest> DoOAuthRequest(string oauthSource)
=======
#if !SILVERLIGHT
public override Action<HttpWebRequest> DoOAuthRequest(string oauthSource)
>>>>>>>
#if !SILVERLIGHT && !NETFX_CORE
public override Action<HttpWebRequest> DoOAuthRequest(string oauthSource) |
<<<<<<<
using Raven.Abstractions.Data;
=======
using Raven.Database.Indexing;
>>>>>>>
using Raven.Database.Indexing;
using Raven.Abstractions.Data; |
<<<<<<<
commpressedData.Flush();
=======
return stream.CanSeek ? stream.Length : 0;
>>>>>>>
commpressedData.Flush();
return stream.CanSeek ? stream.Length : 0; |
<<<<<<<
LastIndexedEtag = Etag.Parse(readResult.Key.Value<byte[]>("lastEtag")),
=======
LastIndexedEtag = new Guid(readResult.Key.Value<byte[]>("lastEtag")),
Priority = (IndexingPriority)readResult.Key.Value<int>("priority"),
>>>>>>>
Priority = (IndexingPriority)readResult.Key.Value<int>("priority"),
LastIndexedEtag = Etag.Parse(readResult.Key.Value<byte[]>("lastEtag")),
<<<<<<<
public void UpdateLastIndexed(string index, Etag etag, DateTime timestamp)
=======
public void SetIndexPriority(string index, IndexingPriority priority)
{
var readResult = storage.IndexingStats.Read(index);
if (readResult == null)
throw new ArgumentException(string.Format("There is no index with the name: '{0}'", index));
var key = (RavenJObject)readResult.Key.CloneToken();
key["priority"] = (int) priority;
storage.IndexingStats.UpdateKey(key);
}
public void UpdateLastIndexed(string index, Guid etag, DateTime timestamp)
>>>>>>>
public void SetIndexPriority(string index, IndexingPriority priority)
{
var readResult = storage.IndexingStats.Read(index);
if (readResult == null)
throw new ArgumentException(string.Format("There is no index with the name: '{0}'", index));
var key = (RavenJObject)readResult.Key.CloneToken();
key["priority"] = (int) priority;
storage.IndexingStats.UpdateKey(key);
}
public void UpdateLastIndexed(string index, Etag etag, DateTime timestamp) |
<<<<<<<
TimeEntryView Patch(TimeEntryTime timeEntryData);
void Delete(int timeEntryId);
=======
void Delete(int timeEntryId, string userName);
>>>>>>>
void Delete(int timeEntryId); |
<<<<<<<
var parameters = new MoreLikeThisQueryParameters
{
DocumentId = match.Groups[2].Value,
Fields = context.Request.QueryString.GetValues("fields"),
Boost = GetNullableBool(context.Request.QueryString.Get("boost")),
MaximumNumberOfTokensParsed = GetNullableInt(context.Request.QueryString.Get("maxNumTokens")),
MaximumQueryTerms = GetNullableInt(context.Request.QueryString.Get("maxQueryTerms")),
MaximumWordLength = GetNullableInt(context.Request.QueryString.Get("maxWordLen")),
MinimumDocumentFrequency = GetNullableInt(context.Request.QueryString.Get("minDocFreq")),
MinimumTermFrequency = GetNullableInt(context.Request.QueryString.Get("minTermFreq")),
MinimumWordLength = GetNullableInt(context.Request.QueryString.Get("minWordLen")),
StopWordsDocumentId = context.Request.QueryString.Get("stopWords")
};
=======
var documentId = match.Groups[2].Value;
var fieldNames = context.Request.QueryString.GetValues("fields");
var parameters = new MoreLikeThisQueryParameters
{
Boost = context.Request.QueryString.Get("boost").ToNullableBool(),
MaximumNumberOfTokensParsed = context.Request.QueryString.Get("maxNumTokens").ToNullableInt(),
MaximumQueryTerms = context.Request.QueryString.Get("maxQueryTerms").ToNullableInt(),
MaximumWordLength = context.Request.QueryString.Get("maxWordLen").ToNullableInt(),
MinimumDocumentFrequency = context.Request.QueryString.Get("minDocFreq").ToNullableInt(),
MinimumTermFrequency = context.Request.QueryString.Get("minTermFreq").ToNullableInt(),
MinimumWordLength = context.Request.QueryString.Get("minWordLen").ToNullableInt(),
StopWordsDocumentId = context.Request.QueryString.Get("stopWords"),
};
>>>>>>>
var parameters = new MoreLikeThisQueryParameters
{
DocumentId = match.Groups[2].Value,
Fields = context.Request.QueryString.GetValues("fields"),
Boost = context.Request.QueryString.Get("boost").ToNullableBool(),
MaximumNumberOfTokensParsed = context.Request.QueryString.Get("maxNumTokens").ToNullableInt(),
MaximumQueryTerms = context.Request.QueryString.Get("maxQueryTerms").ToNullableInt(),
MaximumWordLength = context.Request.QueryString.Get("maxWordLen").ToNullableInt(),
MinimumDocumentFrequency = context.Request.QueryString.Get("minDocFreq").ToNullableInt(),
MinimumTermFrequency = context.Request.QueryString.Get("minTermFreq").ToNullableInt(),
MinimumWordLength = context.Request.QueryString.Get("minWordLen").ToNullableInt(),
StopWordsDocumentId = context.Request.QueryString.Get("stopWords"),
};
<<<<<<<
if (string.IsNullOrEmpty(parameters.DocumentId))
{
context.SetStatusToBadRequest();
context.WriteJson(new { Error = "The document id is mandatory" });
return;
}
PerformSearch(context, indexName, indexDefinition, parameters);
=======
PerformSearch(context, indexName, fieldNames, documentId, indexDefinition, parameters);
>>>>>>>
if (string.IsNullOrEmpty(parameters.DocumentId))
{
context.SetStatusToBadRequest();
context.WriteJson(new { Error = "The document id is mandatory" });
return;
}
PerformSearch(context, indexName, indexDefinition, parameters);
<<<<<<<
var ir = searcher.GetIndexReader();
var mlt = new RavenMoreLikeThis(ir);
AssignParameters(mlt, parameters);
if (parameters.StopWordsDocumentId != null)
{
var stopWordsDoc = Database.Get(parameters.StopWordsDocumentId, null);
if (stopWordsDoc == null)
{
context.SetStatusToNotFound();
context.WriteJson(
new
{
Error = "Stop words document " + parameters.StopWordsDocumentId + " could not be found"
});
return;
}
var stopWords = stopWordsDoc.DataAsJson.JsonDeserialization<StopWordsSetup>().StopWords;
mlt.SetStopWords(new Hashtable(stopWords.ToDictionary(x => x.ToLower())));
}
var fieldNames = parameters.Fields ?? GetFieldNames(ir);
mlt.SetFieldNames(fieldNames);
mlt.Analyzers = GetAnalyzers(indexDefinition, fieldNames);
=======
var ir = searcher.GetIndexReader();
var mlt = new RavenMoreLikeThis(ir);
AssignParameters(mlt, parameters);
if (!string.IsNullOrWhiteSpace(parameters.StopWordsDocumentId))
{
var stopWordsDoc = Database.Get(parameters.StopWordsDocumentId, null);
if (stopWordsDoc == null)
{
context.SetStatusToNotFound();
context.WriteJson(
new
{
Error = "Stop words document " + parameters.StopWordsDocumentId + " could not be found"
});
return;
}
var stopWords = stopWordsDoc.DataAsJson.JsonDeserialization<StopWordsSetup>().StopWords;
mlt.SetStopWords(new Hashtable(stopWords.ToDictionary(x => x.ToLower())));
}
fieldNames = fieldNames ?? GetFieldNames(ir);
mlt.SetFieldNames(fieldNames);
mlt.Analyzers = GetAnalyzers(indexDefinition, fieldNames);
>>>>>>>
var ir = searcher.GetIndexReader();
var mlt = new RavenMoreLikeThis(ir);
AssignParameters(mlt, parameters);
if (!string.IsNullOrWhiteSpace(parameters.StopWordsDocumentId))
{
var stopWordsDoc = Database.Get(parameters.StopWordsDocumentId, null);
if (stopWordsDoc == null)
{
context.SetStatusToNotFound();
context.WriteJson(
new
{
Error = "Stop words document " + parameters.StopWordsDocumentId + " could not be found"
});
return;
}
var stopWords = stopWordsDoc.DataAsJson.JsonDeserialization<StopWordsSetup>().StopWords;
mlt.SetStopWords(new Hashtable(stopWords.ToDictionary(x => x.ToLower())));
}
var fieldNames = parameters.Fields ?? GetFieldNames(ir);
mlt.SetFieldNames(fieldNames);
mlt.Analyzers = GetAnalyzers(indexDefinition, fieldNames);
<<<<<<<
.Where(docId => string.Equals(docId, parameters.DocumentId, StringComparison.InvariantCultureIgnoreCase) == false)
.Select(docId => Database.Get(docId, null))
=======
.Where(resultDocId => string.Equals(resultDocId, documentId, StringComparison.InvariantCultureIgnoreCase) == false)
.Select(resultDocId => Database.Get(resultDocId, null))
>>>>>>>
.Where(docId => string.Equals(docId, parameters.DocumentId, StringComparison.InvariantCultureIgnoreCase) == false)
.Select(docId => Database.Get(docId, null))
<<<<<<<
private static int? GetNullableInt(string value)
{
if (value == null) return null;
return int.Parse(value);
}
private static bool? GetNullableBool(string value)
{
if (value == null) return null;
return true;
}
private static void AssignParameters(Similarity.Net.MoreLikeThis mlt, MoreLikeThisQueryParameters parameters)
{
if (parameters.Boost != null) mlt.SetBoost(parameters.Boost.Value);
if (parameters.MaximumNumberOfTokensParsed != null) mlt.SetMaxNumTokensParsed(parameters.MaximumNumberOfTokensParsed.Value);
if (parameters.MaximumQueryTerms != null) mlt.SetMaxQueryTerms(parameters.MaximumQueryTerms.Value);
if (parameters.MaximumWordLength != null) mlt.SetMaxWordLen(parameters.MaximumWordLength.Value);
if (parameters.MinimumDocumentFrequency != null) mlt.SetMinDocFreq(parameters.MinimumDocumentFrequency.Value);
if (parameters.MinimumTermFrequency != null) mlt.SetMinTermFreq(parameters.MinimumTermFrequency.Value);
if (parameters.MinimumWordLength != null) mlt.SetMinWordLen(parameters.MinimumWordLength.Value);
}
private static Dictionary<string, Analyzer> GetAnalyzers(IndexDefinition indexDefinition, IEnumerable<string> fieldNames)
{
return fieldNames.ToDictionary(fieldName => fieldName, fieldName => indexDefinition.GetAnalyzer(fieldName));
}
private static string[] GetFieldNames(IndexReader indexReader)
{
var fields = indexReader.GetFieldNames(IndexReader.FieldOption.INDEXED);
return fields.Where(x => x != Constants.DocumentIdFieldName).ToArray();
}
=======
private static void AssignParameters(Similarity.Net.MoreLikeThis mlt, MoreLikeThisQueryParameters parameters)
{
if (parameters.Boost != null) mlt.SetBoost(parameters.Boost.Value);
if (parameters.MaximumNumberOfTokensParsed != null)
mlt.SetMaxNumTokensParsed(parameters.MaximumNumberOfTokensParsed.Value);
if (parameters.MaximumQueryTerms != null) mlt.SetMaxQueryTerms(parameters.MaximumQueryTerms.Value);
if (parameters.MaximumWordLength != null) mlt.SetMaxWordLen(parameters.MaximumWordLength.Value);
if (parameters.MinimumDocumentFrequency != null) mlt.SetMinDocFreq(parameters.MinimumDocumentFrequency.Value);
if (parameters.MinimumTermFrequency != null) mlt.SetMinTermFreq(parameters.MinimumTermFrequency.Value);
if (parameters.MinimumWordLength != null) mlt.SetMinWordLen(parameters.MinimumWordLength.Value);
}
private static Dictionary<string, Analyzer> GetAnalyzers(IndexDefinition indexDefinition, IEnumerable<string> fieldNames)
{
var dictionary = new Dictionary<string, Analyzer>();
foreach (var fieldName in fieldNames)
{
dictionary.Add(fieldName, indexDefinition.GetAnalyzer(fieldName));
}
return dictionary;
}
private static string[] GetFieldNames(IndexReader indexReader)
{
var fields = indexReader.GetFieldNames(IndexReader.FieldOption.INDEXED);
return fields.Where(x => x != Constants.DocumentIdFieldName).ToArray();
}
>>>>>>>
private static void AssignParameters(Similarity.Net.MoreLikeThis mlt, MoreLikeThisQueryParameters parameters)
{
if (parameters.Boost != null) mlt.SetBoost(parameters.Boost.Value);
if (parameters.MaximumNumberOfTokensParsed != null)
mlt.SetMaxNumTokensParsed(parameters.MaximumNumberOfTokensParsed.Value);
if (parameters.MaximumNumberOfTokensParsed != null) mlt.SetMaxNumTokensParsed(parameters.MaximumNumberOfTokensParsed.Value);
if (parameters.MaximumQueryTerms != null) mlt.SetMaxQueryTerms(parameters.MaximumQueryTerms.Value);
if (parameters.MaximumWordLength != null) mlt.SetMaxWordLen(parameters.MaximumWordLength.Value);
if (parameters.MinimumDocumentFrequency != null) mlt.SetMinDocFreq(parameters.MinimumDocumentFrequency.Value);
if (parameters.MinimumTermFrequency != null) mlt.SetMinTermFreq(parameters.MinimumTermFrequency.Value);
if (parameters.MinimumWordLength != null) mlt.SetMinWordLen(parameters.MinimumWordLength.Value);
}
private static Dictionary<string, Analyzer> GetAnalyzers(IndexDefinition indexDefinition, IEnumerable<string> fieldNames)
{
return fieldNames.ToDictionary(fieldName => fieldName, fieldName => indexDefinition.GetAnalyzer(fieldName));
}
private static string[] GetFieldNames(IndexReader indexReader)
{
var fields = indexReader.GetFieldNames(IndexReader.FieldOption.INDEXED);
return fields.Where(x => x != Constants.DocumentIdFieldName).ToArray();
} |
<<<<<<<
private readonly DatabaseEtagSynchronizer etagSynchronizer;
public DatabaseEtagSynchronizer EtagSynchronizer
{
get { return etagSynchronizer; }
}
=======
private readonly DatabaseEtagSynchronizer etagSynchronizer;
public DatabaseEtagSynchronizer EtagSynchronizer
{
get { return etagSynchronizer; }
}
>>>>>>>
private readonly DatabaseEtagSynchronizer etagSynchronizer;
public DatabaseEtagSynchronizer EtagSynchronizer
{
get { return etagSynchronizer; }
}
<<<<<<<
etagSynchronizer = new DatabaseEtagSynchronizer(TransactionalStorage);
indexingExecuter = new IndexingExecuter(workContext, etagSynchronizer);
=======
etagSynchronizer = new DatabaseEtagSynchronizer(TransactionalStorage);
indexingExecuter = new IndexingExecuter(workContext, etagSynchronizer);
>>>>>>>
etagSynchronizer = new DatabaseEtagSynchronizer(TransactionalStorage);
indexingExecuter = new IndexingExecuter(workContext, etagSynchronizer);
<<<<<<<
=======
using (TransactionalStorage.WriteLock())
{
>>>>>>>
using (TransactionalStorage.WriteLock())
{
<<<<<<<
}, documents =>
{
etagSynchronizer.UpdateSynchronizationState(documents);
indexingExecuter.PrefetchingBehavior.AfterStorageCommitBeforeWorkNotifications(documents);
});
=======
}, documents =>
{
etagSynchronizer.UpdateSynchronizationState(documents);
indexingExecuter.PrefetchingBehavior.AfterStorageCommitBeforeWorkNotifications(documents);
});
>>>>>>>
}, documents =>
{
etagSynchronizer.UpdateSynchronizationState(documents);
indexingExecuter.PrefetchingBehavior.AfterStorageCommitBeforeWorkNotifications(documents);
});
<<<<<<<
var deleted = false;
log.Debug("Delete a document with key: {0} and etag {1}", key, etag);
RavenJObject metadataVar = null;
=======
var deleted = false;
log.Debug("Delete a document with key: {0} and etag {1}", key, etag);
RavenJObject metadataVar = null;
using (TransactionalStorage.WriteLock())
{
>>>>>>>
var deleted = false;
log.Debug("Delete a document with key: {0} and etag {1}", key, etag);
RavenJObject metadataVar = null;
using (TransactionalStorage.WriteLock())
{
<<<<<<<
try
=======
try
{
TransactionalStorage.Batch(actions =>
>>>>>>>
try
{
TransactionalStorage.Batch(actions =>
<<<<<<<
inFlightTransactionalState.Commit(txId, doc => // this just commit the values, not remove the tx
{
log.Debug("Commit of txId {0}: {1} {2}", txId, doc.Delete ? "DEL" : "PUT", doc.Key);
// doc.Etag - represent the _modified_ document etag, and we already
// checked etags on previous PUT/DELETE, so we don't pass it here
if (doc.Delete)
Delete(doc.Key, null, null);
else
Put(doc.Key, null,
doc.Data,
doc.Metadata, null);
});
log.Debug("Commit of tx {0} completed", txId);
});
}
finally
{
inFlightTransactionalState.Rollback(txId); // this is where we actually remove the tx
}
=======
log.Debug("Commit of txId {0}: {1} {2}", txId, doc.Delete ? "DEL" : "PUT", doc.Key);
// doc.Etag - represent the _modified_ document etag, and we already
// checked etags on previous PUT/DELETE, so we don't pass it here
if (doc.Delete)
Delete(doc.Key, null, null);
else
Put(doc.Key, null,
doc.Data,
doc.Metadata, null);
});
log.Debug("Commit of tx {0} completed", txId);
});
>>>>>>>
log.Debug("Commit of txId {0}: {1} {2}", txId, doc.Delete ? "DEL" : "PUT", doc.Key);
// doc.Etag - represent the _modified_ document etag, and we already
// checked etags on previous PUT/DELETE, so we don't pass it here
if (doc.Delete)
Delete(doc.Key, null, null);
else
Put(doc.Key, null,
doc.Data,
doc.Metadata, null);
});
log.Debug("Commit of tx {0} completed", txId);
});
<<<<<<<
while (true)
=======
while (true)
{
try
>>>>>>>
while (true)
{
try
<<<<<<<
var inserts = 0;
var batch = 0;
var keys = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
foreach (var doc in docs)
=======
var inserts = 0;
var batch = 0;
var keys = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
foreach (var doc in docs)
{
RemoveReservedProperties(doc.DataAsJson);
RemoveMetadataReservedProperties(doc.Metadata);
if (options.CheckReferencesInIndexes)
keys.Add(doc.Key);
documents++;
batch++;
AssertPutOperationNotVetoed(doc.Key, doc.Metadata, doc.DataAsJson, null);
foreach (var trigger in PutTriggers)
>>>>>>>
var inserts = 0;
var batch = 0;
var keys = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
foreach (var doc in docs)
{
RemoveReservedProperties(doc.DataAsJson);
RemoveMetadataReservedProperties(doc.Metadata);
if (options.CheckReferencesInIndexes)
keys.Add(doc.Key);
documents++;
batch++;
AssertPutOperationNotVetoed(doc.Key, doc.Metadata, doc.DataAsJson, null);
foreach (var trigger in PutTriggers)
<<<<<<<
=======
accessor.Documents.IncrementDocumentCount(inserts);
accessor.General.PulseTransaction();
workContext.ShouldNotifyAboutWork(() => "BulkInsert batch of " + batch + " docs");
workContext.NotifyAboutWork(); // forcing notification so we would start indexing right away
}
>>>>>>>
accessor.Documents.IncrementDocumentCount(inserts);
accessor.General.PulseTransaction();
workContext.ShouldNotifyAboutWork(() => "BulkInsert batch of " + batch + " docs");
workContext.NotifyAboutWork(); // forcing notification so we would start indexing right away
} |
<<<<<<<
using Raven.Client.Embedded;
using Raven.Client.Listeners;
=======
using Raven.Client.Listeners;
>>>>>>>
using Raven.Client.Embedded;
using Raven.Client.Listeners;
<<<<<<<
protected void WaitForReplication(IDocumentStore store, Func<IDocumentSession, bool> predicate, string db = null)
{
for (int i = 0; i < RetriesCount; i++)
{
using (var session = store.OpenSession(db))
{
if (predicate(session))
return;
Thread.Sleep(100);
}
}
}
protected class ClientSideConflictResolution : IDocumentConflictListener
{
public bool TryResolveConflict(string key, JsonDocument[] conflictedDocs, out JsonDocument resolvedDocument)
{
resolvedDocument = new JsonDocument
{
DataAsJson = new RavenJObject
{
{"Name", string.Join(" ", conflictedDocs.Select(x => x.DataAsJson.Value<string>("Name")).OrderBy(x=>x))}
},
Metadata = new RavenJObject()
};
return true;
}
}
=======
protected class ClientSideConflictResolution : IDocumentConflictListener
{
public bool TryResolveConflict(string key, JsonDocument[] conflictedDocs, out JsonDocument resolvedDocument)
{
resolvedDocument = new JsonDocument
{
DataAsJson = new RavenJObject
{
{"Name", string.Join(" ", conflictedDocs.Select(x => x.DataAsJson.Value<string>("Name")).OrderBy(x=>x))}
},
Metadata = new RavenJObject()
};
return true;
}
}
protected void WaitForReplication(IDocumentStore store, Func<IDocumentSession, bool> predicate, string db = null)
{
for (int i = 0; i < RetriesCount; i++)
{
using (var session = store.OpenSession(new OpenSessionOptions
{
Database = db,
ForceReadFromMaster = true
}))
{
if (predicate(session))
return;
Thread.Sleep(100);
}
}
}
>>>>>>>
protected void WaitForReplication(IDocumentStore store, Func<IDocumentSession, bool> predicate, string db = null)
{
for (int i = 0; i < RetriesCount; i++)
{
using (var session = store.OpenSession(new OpenSessionOptions
{
Database = db,
ForceReadFromMaster = true
}))
{
if (predicate(session))
return;
Thread.Sleep(100);
}
}
}
protected class ClientSideConflictResolution : IDocumentConflictListener
{
public bool TryResolveConflict(string key, JsonDocument[] conflictedDocs, out JsonDocument resolvedDocument)
{
resolvedDocument = new JsonDocument
{
DataAsJson = new RavenJObject
{
{"Name", string.Join(" ", conflictedDocs.Select(x => x.DataAsJson.Value<string>("Name")).OrderBy(x=>x))}
},
Metadata = new RavenJObject()
};
return true;
}
} |
<<<<<<<
public bool Authorize(IHttpContext ctx, bool hasApiKey, bool ignoreDb)
=======
public bool Authorize(IHttpContext ctx, bool hasApiKey, bool ignoreDbAccess)
>>>>>>>
public bool Authorize(IHttpContext ctx, bool hasApiKey, bool ignoreDbAccess)
<<<<<<<
if (allowUnauthenticatedUsers || ignoreDb)
=======
if (allowUnauthenticatedUsers || ignoreDbAccess)
>>>>>>>
if (allowUnauthenticatedUsers)
if (allowUnauthenticatedUsers || ignoreDbAccess)
if (allowUnauthenticatedUsers || ignoreDb) |
<<<<<<<
storage.Batch(accessor => accessor.Indexing.DeleteIndex(a, new CancellationToken()));
=======
storage.Batch(accessor => accessor.Indexing.DeleteIndex("a", new CancellationToken()));
>>>>>>>
storage.Batch(accessor => accessor.Indexing.DeleteIndex(a, new CancellationToken()));
<<<<<<<
storage.Batch(accessor => accessor.Indexing.DeleteIndex(a, new CancellationToken()));
=======
storage.Batch(accessor => accessor.Indexing.DeleteIndex("a", new CancellationToken()));
>>>>>>>
storage.Batch(accessor => accessor.Indexing.DeleteIndex("a"));
storage.Batch(accessor => accessor.Indexing.DeleteIndex("a", new CancellationToken()));
storage.Batch(accessor => accessor.Indexing.DeleteIndex(a, new CancellationToken())); |
<<<<<<<
#if !NET35
, SetupCommandsAsync(AsyncDatabaseCommands, options.Database, options.Credentials)
=======
#if !NET_3_5
, SetupCommandsAsync(AsyncDatabaseCommands, options.Database, options.Credentials, options)
>>>>>>>
#if !NET35
, SetupCommandsAsync(AsyncDatabaseCommands, options.Database, options.Credentials, options)
<<<<<<<
#if !NET35
private static IAsyncDatabaseCommands SetupCommandsAsync(IAsyncDatabaseCommands databaseCommands, string database, ICredentials credentialsForSession)
=======
#endif
#if !NET_3_5
private static IAsyncDatabaseCommands SetupCommandsAsync(IAsyncDatabaseCommands databaseCommands, string database, ICredentials credentialsForSession, OpenSessionOptions options)
>>>>>>>
#if !NET_3_5
#endif
#if !NET_3_5
#if !NET35
private static IAsyncDatabaseCommands SetupCommandsAsync(IAsyncDatabaseCommands databaseCommands, string database, ICredentials credentialsForSession, OpenSessionOptions options) |
<<<<<<<
var result = await CreateReportFileByteUpdateFileNameContentTypeAsync(emailData, groupedList);
=======
var fileByte = CreateReportFileByteUpdateFileNameContentType(emailData, groupedList);
>>>>>>>
var fileByte = await CreateReportFileByteUpdateFileNameContentTypeAsync(emailData, groupedList);
<<<<<<<
builder.Attachments.Add(fileName, result.Item2);
=======
builder.Attachments.Add(FileName, fileByte);
>>>>>>>
builder.Attachments.Add(FileName, fileByte); |
<<<<<<<
=======
using System;
using System.Collections.Generic;
>>>>>>>
using System.Collections.Generic; |
<<<<<<<
if (string.Equals(index, indexFromDb, StringComparison.OrdinalIgnoreCase) == false)
=======
if (string.Equals(getItemsToReduceParams.Index, indexFromDb, StringComparison.InvariantCultureIgnoreCase) == false)
>>>>>>>
if (string.Equals(getItemsToReduceParams.Index, indexFromDb, StringComparison.OrdinalIgnoreCase) == false) |
<<<<<<<
MailCost,
ResizeInventory,
=======
MailCost,
NewIntelligentCreature,
UpdateIntelligentCreatureList,
IntelligentCreatureEnableRename
>>>>>>>
MailCost,
ResizeInventory,
NewIntelligentCreature,
UpdateIntelligentCreatureList,
IntelligentCreatureEnableRename
<<<<<<<
case (short)ServerPacketIds.ResizeInventory:
return new S.ResizeInventory();
=======
case (short)ServerPacketIds.NewIntelligentCreature://IntelligentCreature
return new S.NewIntelligentCreature();
case (short)ServerPacketIds.UpdateIntelligentCreatureList://IntelligentCreature
return new S.UpdateIntelligentCreatureList();
case (short)ServerPacketIds.IntelligentCreatureEnableRename://IntelligentCreature
return new S.IntelligentCreatureEnableRename();
>>>>>>>
case (short)ServerPacketIds.ResizeInventory:
return new S.ResizeInventory(); case (short)ServerPacketIds.NewIntelligentCreature://IntelligentCreature
return new S.NewIntelligentCreature();
case (short)ServerPacketIds.UpdateIntelligentCreatureList://IntelligentCreature
return new S.UpdateIntelligentCreatureList();
case (short)ServerPacketIds.IntelligentCreatureEnableRename://IntelligentCreature
return new S.IntelligentCreatureEnableRename(); |
<<<<<<<
RemovePet,
ConquestGuard,
ConquestGate,
ConquestWall,
ConquestSiege,
TakeConquestGold,
SetConquestRate,
StartConquest,
ScheduleConquest,
OpenGate,
CloseGate,
=======
RemovePet,
Break
>>>>>>>
RemovePet
RemovePet,
ConquestGuard,
ConquestGate,
ConquestWall,
ConquestSiege,
TakeConquestGold,
SetConquestRate,
StartConquest,
ScheduleConquest,
OpenGate,
CloseGate,
<<<<<<<
HasBagSpace,
CheckConquest,
AffordGuard,
AffordGate,
AffordWall,
AffordSiege,
CheckPermission,
ConquestAvailable,
ConquestOwner,
=======
HasBagSpace,
IsNewHuman
>>>>>>>
HasBagSpace,
IsNewHuman
HasBagSpace,
CheckConquest,
AffordGuard,
AffordGate,
AffordWall,
AffordSiege,
CheckPermission,
ConquestAvailable,
ConquestOwner, |
<<<<<<<
case (short)ServerPacketIds.GuildBuffList:
GuildBuffList((S.GuildBuffList)p);
break;
=======
case (short)ServerPacketIds.LoverUpdate:
LoverUpdate((S.LoverUpdate)p);
break;
case (short)ServerPacketIds.MentorUpdate:
MentorUpdate((S.MentorUpdate)p);
break;
>>>>>>>
case (short)ServerPacketIds.LoverUpdate:
LoverUpdate((S.LoverUpdate)p);
break;
case (short)ServerPacketIds.MentorUpdate:
MentorUpdate((S.MentorUpdate)p);
break;
case (short)ServerPacketIds.GuildBuffList:
GuildBuffList((S.GuildBuffList)p);
break;
<<<<<<<
private bool UpdateGuildBuff(GuildBuff buff, bool Remove = false)
{
for (int i = 0; i < GuildBuffDialog.EnabledBuffs.Count; i++)
{
if (GuildBuffDialog.EnabledBuffs[i].Id == buff.Id)
{
if (Remove)
{
GuildBuffImgList.RemoveAt(i);
GuildBuffDialog.EnabledBuffs.RemoveAt(i);
}
else
GuildBuffDialog.EnabledBuffs[i] = buff;
return true;
}
}
return false;
}
private void GuildBuffList(S.GuildBuffList p)
{
for (int i = 0; i < p.GuildBuffs.Count; i++)
{
GuildBuffDialog.GuildBuffInfos.Add(p.GuildBuffs[i]);
}
for (int i = 0; i < p.ActiveBuffs.Count; i++)
{
//if (p.ActiveBuffs[i].ActiveTimeRemaining > 0)
// p.ActiveBuffs[i].ActiveTimeRemaining = Convert.ToInt32(CMain.Time / 1000) + (p.ActiveBuffs[i].ActiveTimeRemaining * 60);
if (UpdateGuildBuff(p.ActiveBuffs[i], p.Remove == 1)) continue;
if (!(p.Remove == 1))
{
GuildBuffDialog.EnabledBuffs.Add(p.ActiveBuffs[i]);
CreateGuildBuff(p.ActiveBuffs[i]);
}
}
for (int i = 0; i < GuildBuffDialog.EnabledBuffs.Count; i++)
if (GuildBuffDialog.EnabledBuffs[i].Info == null)
GuildBuffDialog.EnabledBuffs[i].Info = GuildBuffDialog.FindGuildBuffInfo(GuildBuffDialog.EnabledBuffs[i].Id);
User.RefreshStats();
}
=======
private void MarriageRequest(S.MarriageRequest p)
{
MirMessageBox messageBox = new MirMessageBox(string.Format("{0} has asked for your hand in marriage.", p.Name), MirMessageBoxButtons.YesNo);
messageBox.YesButton.Click += (o, e) => Network.Enqueue(new C.MarriageReply { AcceptInvite = true });
messageBox.NoButton.Click += (o, e) => { Network.Enqueue(new C.MarriageReply { AcceptInvite = false }); messageBox.Dispose(); };
messageBox.Show();
}
private void DivorceRequest(S.DivorceRequest p)
{
MirMessageBox messageBox = new MirMessageBox(string.Format("{0} has requested a divorce", p.Name), MirMessageBoxButtons.YesNo);
messageBox.YesButton.Click += (o, e) => Network.Enqueue(new C.DivorceReply { AcceptInvite = true });
messageBox.NoButton.Click += (o, e) => { Network.Enqueue(new C.DivorceReply { AcceptInvite = false }); messageBox.Dispose(); };
messageBox.Show();
}
private void MentorRequest(S.MentorRequest p)
{
MirMessageBox messageBox = new MirMessageBox(string.Format("{0} (Level {1}) has requested you teach him the ways of the {2}.", p.Name, p.Level, GameScene.User.Class.ToString()), MirMessageBoxButtons.YesNo);
messageBox.YesButton.Click += (o, e) => Network.Enqueue(new C.MentorReply { AcceptInvite = true });
messageBox.NoButton.Click += (o, e) => { Network.Enqueue(new C.MentorReply { AcceptInvite = false }); messageBox.Dispose(); };
messageBox.Show();
}
>>>>>>>
private void MarriageRequest(S.MarriageRequest p)
{
MirMessageBox messageBox = new MirMessageBox(string.Format("{0} has asked for your hand in marriage.", p.Name), MirMessageBoxButtons.YesNo);
messageBox.YesButton.Click += (o, e) => Network.Enqueue(new C.MarriageReply { AcceptInvite = true });
messageBox.NoButton.Click += (o, e) => { Network.Enqueue(new C.MarriageReply { AcceptInvite = false }); messageBox.Dispose(); };
messageBox.Show();
}
private void DivorceRequest(S.DivorceRequest p)
{
MirMessageBox messageBox = new MirMessageBox(string.Format("{0} has requested a divorce", p.Name), MirMessageBoxButtons.YesNo);
messageBox.YesButton.Click += (o, e) => Network.Enqueue(new C.DivorceReply { AcceptInvite = true });
messageBox.NoButton.Click += (o, e) => { Network.Enqueue(new C.DivorceReply { AcceptInvite = false }); messageBox.Dispose(); };
messageBox.Show();
}
private void MentorRequest(S.MentorRequest p)
{
MirMessageBox messageBox = new MirMessageBox(string.Format("{0} (Level {1}) has requested you teach him the ways of the {2}.", p.Name, p.Level, GameScene.User.Class.ToString()), MirMessageBoxButtons.YesNo);
messageBox.YesButton.Click += (o, e) => Network.Enqueue(new C.MentorReply { AcceptInvite = true });
messageBox.NoButton.Click += (o, e) => { Network.Enqueue(new C.MentorReply { AcceptInvite = false }); messageBox.Dispose(); };
messageBox.Show();
}
private bool UpdateGuildBuff(GuildBuff buff, bool Remove = false)
{
for (int i = 0; i < GuildBuffDialog.EnabledBuffs.Count; i++)
{
if (GuildBuffDialog.EnabledBuffs[i].Id == buff.Id)
{
if (Remove)
{
GuildBuffImgList.RemoveAt(i);
GuildBuffDialog.EnabledBuffs.RemoveAt(i);
}
else
GuildBuffDialog.EnabledBuffs[i] = buff;
return true;
}
}
return false;
}
private void GuildBuffList(S.GuildBuffList p)
{
for (int i = 0; i < p.GuildBuffs.Count; i++)
{
GuildBuffDialog.GuildBuffInfos.Add(p.GuildBuffs[i]);
}
for (int i = 0; i < p.ActiveBuffs.Count; i++)
{
//if (p.ActiveBuffs[i].ActiveTimeRemaining > 0)
// p.ActiveBuffs[i].ActiveTimeRemaining = Convert.ToInt32(CMain.Time / 1000) + (p.ActiveBuffs[i].ActiveTimeRemaining * 60);
if (UpdateGuildBuff(p.ActiveBuffs[i], p.Remove == 1)) continue;
if (!(p.Remove == 1))
{
GuildBuffDialog.EnabledBuffs.Add(p.ActiveBuffs[i]);
CreateGuildBuff(p.ActiveBuffs[i]);
}
}
for (int i = 0; i < GuildBuffDialog.EnabledBuffs.Count; i++)
if (GuildBuffDialog.EnabledBuffs[i].Info == null)
GuildBuffDialog.EnabledBuffs[i].Info = GuildBuffDialog.FindGuildBuffInfo(GuildBuffDialog.EnabledBuffs[i].Id);
User.RefreshStats();
} |
<<<<<<<
this.Category_textbox.Location = new System.Drawing.Point(86, 155);
this.Category_textbox.MaxLength = 0;
this.Category_textbox.Name = "Category_textbox";
this.Category_textbox.Size = new System.Drawing.Size(173, 20);
this.Category_textbox.TabIndex = 108;
this.Category_textbox.TextChanged += new System.EventHandler(this.Category_textbox_TextChanged);
=======
this.Catagory_textbox.Location = new System.Drawing.Point(86, 183);
this.Catagory_textbox.MaxLength = 0;
this.Catagory_textbox.Name = "Catagory_textbox";
this.Catagory_textbox.Size = new System.Drawing.Size(173, 20);
this.Catagory_textbox.TabIndex = 108;
this.Catagory_textbox.TextChanged += new System.EventHandler(this.Catagory_textbox_TextChanged);
>>>>>>>
this.Category_textbox.Location = new System.Drawing.Point(86, 183);
this.Category_textbox.MaxLength = 0;
this.Category_textbox.Name = "Category_textbox";
this.Category_textbox.Size = new System.Drawing.Size(173, 20);
this.Category_textbox.TabIndex = 108;
this.Category_textbox.TextChanged += new System.EventHandler(this.Category_textbox_TextChanged); |
<<<<<<<
GuildBuff,
=======
RelationshipEXP,
Mentee,
Mentor,
>>>>>>>
RelationshipEXP,
Mentee,
Mentor,
GuildBuff,
<<<<<<<
FriendUpdate,
GuildBuffList
=======
FriendUpdate,
LoverUpdate,
MentorUpdate,
>>>>>>>
FriendUpdate,
LoverUpdate,
MentorUpdate,
GuildBuffList
<<<<<<<
case (short)ServerPacketIds.GuildBuffList:
return new S.GuildBuffList();
=======
case (short)ServerPacketIds.LoverUpdate:
return new S.LoverUpdate();
case (short)ServerPacketIds.MentorUpdate:
return new S.MentorUpdate();
>>>>>>>
case (short)ServerPacketIds.LoverUpdate:
return new S.LoverUpdate();
case (short)ServerPacketIds.MentorUpdate:
return new S.MentorUpdate();
case (short)ServerPacketIds.GuildBuffList:
return new S.GuildBuffList(); |
<<<<<<<
case (short)ClientPacketIds.GameshopBuy:
GameshopBuy((C.GameshopBuy)p);
return;
=======
case (short)ClientPacketIds.NPCConfirmInput:
NPCConfirmInput((C.NPCConfirmInput)p);
break;
>>>>>>>
case (short)ClientPacketIds.GameshopBuy:
GameshopBuy((C.GameshopBuy)p);
return;
case (short)ClientPacketIds.NPCConfirmInput:
NPCConfirmInput((C.NPCConfirmInput)p);
break;
<<<<<<<
private void GameshopBuy(C.GameshopBuy p)
{
if (Stage != GameStage.Game) return;
Player.GameshopBuy(p.ItemIndex, p.Quantity);
}
=======
private void NPCConfirmInput(C.NPCConfirmInput p)
{
if (Stage != GameStage.Game) return;
Player.NPCInputStr = p.Value;
Player.CallNPC(Player.NPCID, p.PageName);
}
>>>>>>>
private void GameshopBuy(C.GameshopBuy p)
{
if (Stage != GameStage.Game) return;
Player.GameshopBuy(p.ItemIndex, p.Quantity);
}
private void NPCConfirmInput(C.NPCConfirmInput p)
{
if (Stage != GameStage.Game) return;
Player.NPCInputStr = p.Value;
Player.CallNPC(Player.NPCID, p.PageName);
} |
<<<<<<<
case 71://Sabuk Archer
return new ConquestArcher(info);
case 72:
return new Gate(info);
case 73:
return new Wall(info);
=======
>>>>>>>
case 71:
return new SabukGate(info);
case 71://Sabuk Archer
return new ConquestArcher(info);
case 72:
return new Gate(info);
case 73:
return new Wall(info); |
<<<<<<<
NPCs = new MLibrary[200],
Mounts = new MLibrary[16],
Fishing = new MLibrary[2];
=======
NPCs = new MLibrary[186],
Mounts = new MLibrary[12],
Fishing = new MLibrary[2],
Pets = new MLibrary[10];//IntelligentCreature
>>>>>>>
Mounts = new MLibrary[12],
Fishing = new MLibrary[2],
Pets = new MLibrary[10];//IntelligentCreature |
<<<<<<<
try
{
info.UsedFilesInOlderGenerations = usedFileIds.Select(fi => GetGeneration(fi))
.Where(gen => gen < trlGeneration).OrderBy(a => a).ToArray();
}
catch (ArgumentOutOfRangeException)
{
// KVI uses missing pvl/trl file
info.UsedFilesInOlderGenerations = new long[0];
return false;
}
=======
info.UsedFilesInOlderGenerations = usedFileIds.Select(fi => GetGenerationIgnoreMissing(fi)).Where(gen => gen > 0 && gen < trlGeneration).OrderBy(a => a).ToArray();
>>>>>>>
info.UsedFilesInOlderGenerations = usedFileIds.Select(GetGenerationIgnoreMissing).Where(gen => gen > 0 && gen < trlGeneration).OrderBy(a => a).ToArray();
<<<<<<<
try
{
info.UsedFilesInOlderGenerations = usedFileIds.Select(fi => GetGeneration(fi))
.Where(gen => gen < trlGeneration).OrderBy(a => a).ToArray();
}
catch (ArgumentOutOfRangeException)
{
// KVI uses missing pvl/trl file
return false;
}
=======
info.UsedFilesInOlderGenerations = usedFileIds.Select(fi => GetGenerationIgnoreMissing(fi)).Where(gen => gen > 0 && gen < trlGeneration).OrderBy(a => a).ToArray();
>>>>>>>
info.UsedFilesInOlderGenerations = usedFileIds.Select(fi => GetGenerationIgnoreMissing(fi)).Where(gen => gen > 0 && gen < trlGeneration).OrderBy(a => a).ToArray();
<<<<<<<
_writerWithTransactionLog.WriteUInt8((byte) KVCommandType.TemporaryEndOfFile);
_writerWithTransactionLog.FlushBuffer();
_fileWithTransactionLog.HardFlush();
_fileWithTransactionLog.Truncate();
=======
_writerWithTransactionLog.WriteUInt8((byte)KVCommandType.TemporaryEndOfFile);
_fileWithTransactionLog.HardFlushTruncateSwitchToDisposedMode();
>>>>>>>
_writerWithTransactionLog.WriteUInt8((byte) KVCommandType.TemporaryEndOfFile);
_fileWithTransactionLog.HardFlushTruncateSwitchToDisposedMode();
<<<<<<<
if (DurableTransactions || !temporaryCloseTransactionLog)
_writerWithTransactionLog.FlushBuffer();
UpdateTransactionLogInBTreeRoot(btreeRoot);
=======
>>>>>>>
<<<<<<<
_writerWithTransactionLog.WriteUInt8((byte) KVCommandType.TemporaryEndOfFile);
_writerWithTransactionLog.FlushBuffer();
if (DurableTransactions)
_fileWithTransactionLog.HardFlush();
=======
_writerWithTransactionLog.WriteUInt8((byte)KVCommandType.TemporaryEndOfFile);
_fileWithTransactionLog.Flush();
>>>>>>>
_writerWithTransactionLog.WriteUInt8((byte) KVCommandType.TemporaryEndOfFile);
_fileWithTransactionLog.Flush();
<<<<<<<
_writerWithTransactionLog.WriteUInt8((byte) KVCommandType.Rollback);
_writerWithTransactionLog.FlushBuffer();
=======
_writerWithTransactionLog.WriteUInt8((byte)KVCommandType.Rollback);
_fileWithTransactionLog.Flush();
>>>>>>>
_writerWithTransactionLog.WriteUInt8((byte) KVCommandType.Rollback);
_fileWithTransactionLog.Flush();
<<<<<<<
_writerWithTransactionLog.WriteUInt8((byte) KVCommandType.EndOfFile);
FlushCurrentTrl();
=======
_writerWithTransactionLog.WriteUInt8((byte)KVCommandType.EndOfFile);
_fileWithTransactionLog.HardFlushTruncateSwitchToReadOnlyMode();
>>>>>>>
_writerWithTransactionLog.WriteUInt8((byte) KVCommandType.EndOfFile);
_fileWithTransactionLog.HardFlushTruncateSwitchToReadOnlyMode();
<<<<<<<
void FlushCurrentTrl()
{
_writerWithTransactionLog.FlushBuffer();
_fileWithTransactionLog.HardFlush();
_fileWithTransactionLog.Truncate();
}
public void WriteCreateOrUpdateCommand(byte[] prefix, ByteBuffer key, ByteBuffer value, out uint valueFileId,
out uint valueOfs, out int valueSize)
=======
public void WriteCreateOrUpdateCommand(byte[] prefix, ByteBuffer key, ByteBuffer value, out uint valueFileId, out uint valueOfs, out int valueSize)
>>>>>>>
public void WriteCreateOrUpdateCommand(byte[] prefix, ByteBuffer key, ByteBuffer value, out uint valueFileId,
out uint valueOfs, out int valueSize)
<<<<<<<
writer.FlushBuffer();
=======
>>>>>>> |
<<<<<<<
_stream = new FileStream(fileName, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.None, 1,
FileOptions.None);
=======
_stream = new FileStream(fileName, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.None, 1, FileOptions.None);
_handle = _stream.SafeFileHandle;
>>>>>>>
_stream = new FileStream(fileName, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.None, 1,
FileOptions.None);
_handle = _stream.SafeFileHandle;
<<<<<<<
_position = (ulong) _stream.Position;
=======
>>>>>>>
<<<<<<<
lock (_lock)
{
FlushWriteBuf();
if (_position != pos)
{
_stream.Position = (long) pos;
_position = pos;
}
try
{
#if NETCOREAPP
var res = _stream.Read(data);
#else
var tempBuf = new byte[data.Length];
var res = _stream.Read(tempBuf, 0, tempBuf.Length);
tempBuf.AsSpan().CopyTo(data);
#endif
_position += (ulong) res;
return res;
}
catch (Exception)
{
_position = (ulong) _stream.Position;
throw;
}
}
}
void FlushWriteBuf()
{
if (_writeBufUsed == 0) return;
if (_position != _writeBufStart)
{
_stream.Position = (long) _writeBufStart;
_position = _writeBufStart;
}
try
{
_stream.Write(_writeBuf, 0, _writeBufUsed);
_position += (ulong) _writeBufUsed;
_writeBufUsed = 0;
}
catch (Exception)
{
_position = (ulong) _stream.Position;
_writeBufUsed = 0;
throw;
}
=======
return (int)PlatformMethods.Instance.PRead(_handle, data.AsSpan(offset, size), pos);
>>>>>>>
return (int)PlatformMethods.Instance.PRead(_handle, data, pos);
<<<<<<<
lock (_lock)
{
if (data.Length < _writeBufSize)
{
if (_writeBuf == null)
{
_writeBuf = new byte[_writeBufSize];
}
if (_writeBufUsed > 0)
{
if (pos >= _writeBufStart && pos <= _writeBufStart + (ulong) _writeBufUsed &&
pos + (ulong) data.Length <= _writeBufStart + (ulong) _writeBufSize)
{
var writeBufOfs = (int) (pos - _writeBufStart);
data.CopyTo(new Span<byte>(_writeBuf, writeBufOfs, data.Length));
_writeBufUsed = Math.Max(_writeBufUsed, writeBufOfs + data.Length);
return;
}
}
else
{
_writeBufStart = pos;
data.CopyTo(new Span<byte>(_writeBuf, 0, data.Length));
_writeBufUsed = data.Length;
return;
}
}
FlushWriteBuf();
if (_position != pos)
{
_stream.Position = (long) pos;
_position = pos;
}
try
{
#if NETCOREAPP
_stream.Write(data);
#else
_stream.Write(data.ToArray(), 0, data.Length);
#endif
_position += (ulong) data.Length;
}
catch (Exception)
{
_position = (ulong) _stream.Position;
throw;
}
}
=======
PlatformMethods.Instance.PWrite(_handle, data.AsSpan(offset, size), pos);
>>>>>>>
PlatformMethods.Instance.PWrite(_handle, data, pos);
<<<<<<<
lock (_lock)
{
var res = (ulong) _stream.Length;
if (_writeBufUsed > 0)
{
res = Math.Max(res, _writeBufStart + (ulong) _writeBufUsed);
}
return res;
}
=======
return (ulong)_stream.Length;
>>>>>>>
return (ulong)_stream.Length;
<<<<<<<
lock (_lock)
{
FlushWriteBuf();
_stream.SetLength((long) size);
_position = (ulong) _stream.Position;
}
=======
_stream.SetLength((long)size);
>>>>>>>
_stream.SetLength((long)size); |
<<<<<<<
BuildSelect(sb, GetScaffoldableProperties((T)Activator.CreateInstance(typeof(T))).ToArray());
sb.AppendFormat(" from {0} where ", name);
for (var i = 0; i < idProps.Count; i++)
{
if (i > 0)
sb.Append(" and ");
sb.AppendFormat("{0} = @{1}", GetColumnName(idProps[i]), idProps[i].Name);
}
=======
BuildSelect(sb, GetScaffoldableProperties<T>().ToArray());
sb.AppendFormat(" from {0}", name);
sb.Append(" where " + GetColumnName(onlyKey) + " = @Id");
>>>>>>>
BuildSelect(sb, GetScaffoldableProperties<T>().ToArray());
sb.AppendFormat(" from {0} where ", name);
for (var i = 0; i < idProps.Count; i++)
{
if (i > 0)
sb.Append(" and ");
sb.AppendFormat("{0} = @{1}", GetColumnName(idProps[i]), idProps[i].Name);
} |
<<<<<<<
using White.Core;
using White.Core.Testing;
using White.Core.UIItems;
=======
using White.Core;
using White.Core.UIItems;
using White.UnitTests.Core.Testing;
>>>>>>>
using White.Core;
using White.Core.Testing;
using White.Core.UIItems;
using White.UnitTests.Core.Testing; |
<<<<<<<
using TestStack.White.UIA;
using TestStack.White.UIItems.Actions;
=======
using White.Core.UIA;
using White.Core.UIItems.Actions;
using White.Core.WindowsAPI;
>>>>>>>
using TestStack.White.UIA;
using TestStack.White.UIItems.Actions;
using White.Core.WindowsAPI; |
<<<<<<<
=======
if (_exceptionContext.Result == null)
{
_exceptionContext.Result = new EmptyResult();
}
Task task;
>>>>>>>
if (_exceptionContext.Result == null)
{
_exceptionContext.Result = new EmptyResult();
}
<<<<<<<
goto case State.ResourceInsideEnd;
=======
// Found this while investigating #5594. This is not right, but we think it's harmless
// so we're leaving it here for the patch release. This should go to InvokeEnd if the
// scope is not Resource because that can only happen when there are no resource filters.
goto case State.ResourceEnd;
>>>>>>>
goto case State.ResourceInsideEnd; |
<<<<<<<
[Fact]
public async Task RazorPage_WithLinks_GeneratesLinksCorrectly()
{
// Arrange & Act
var response = await Client.GetAsync("http://localhost/PageWithLinks");
// Assert
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
var document = await response.GetHtmlDocumentAsync();
var editLink = document.RequiredQuerySelector("#editlink");
Assert.Equal("/Edit/10", editLink.GetAttribute("href"));
var contactLink = document.RequiredQuerySelector("#contactlink");
Assert.Equal("/Home/Contact", contactLink.GetAttribute("href"));
}
=======
[Fact]
public async Task CanRunMiddlewareAfterRouting()
{
// Act
var response = await Client.GetAsync("/afterrouting");
// Assert
await response.AssertStatusCodeAsync(HttpStatusCode.OK);
var content = await response.Content.ReadAsStringAsync();
Assert.Equal("Hello from middleware after routing", content);
}
>>>>>>>
[Fact]
public async Task RazorPage_WithLinks_GeneratesLinksCorrectly()
{
// Arrange & Act
var response = await Client.GetAsync("http://localhost/PageWithLinks");
// Assert
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
var document = await response.GetHtmlDocumentAsync();
var editLink = document.RequiredQuerySelector("#editlink");
Assert.Equal("/Edit/10", editLink.GetAttribute("href"));
var contactLink = document.RequiredQuerySelector("#contactlink");
Assert.Equal("/Home/Contact", contactLink.GetAttribute("href"));
}
[Fact]
public async Task CanRunMiddlewareAfterRouting()
{
// Act
var response = await Client.GetAsync("/afterrouting");
// Assert
await response.AssertStatusCodeAsync(HttpStatusCode.OK);
var content = await response.Content.ReadAsStringAsync();
Assert.Equal("Hello from middleware after routing", content);
} |
<<<<<<<
=======
/// Converts a <see cref="Color" /> struct to a <see cref="System.Drawing.Color" /> struct.
/// </summary>
/// <param name="color">The <see cref="Color" /> to convert.</param>
/// <returns>
/// An instance of <see cref="System.Drawing.Color" /> representing the
/// value of the <paramref name="color" /> argument.
/// </returns>
public static implicit operator SystemColor(Color color)
{
return SystemColor.FromArgb(color.R, color.G, color.B);
}
/// <summary>
/// Converts a <see cref="System.Drawing.Color" /> struct to a <see cref="Color" /> struct.
/// </summary>
/// <param name="color">The <see cref="System.Drawing.Color" /> to convert.</param>
/// <returns>
/// An instance of <see cref="Color" /> representing the value of the <paramref name="color" /> argument.
/// </returns>
public static implicit operator Color(SystemColor color)
{
return FromSystemColor(color);
}
/// <summary>
/// Converts a <see cref="Color" /> struct to a <see cref="System.Windows.Media.Color" /> struct.
/// </summary>
/// <param name="color">The <see cref="Color" /> to convert.</param>
/// <returns>
/// An instance of <see cref="System.Windows.Media.Color" /> representing the
/// value of the <paramref name="color" /> argument.
/// </returns>
public static implicit operator WpfColor(Color color)
{
return WpfColor.FromRgb(color.R, color.G, color.B);
}
/// <summary>
/// Converts a <see cref="System.Windows.Media.Color" /> struct to a <see cref="Color" /> struct.
/// </summary>
/// <param name="color">The <see cref="System.Windows.Media.Color" /> to convert.</param>
/// <returns>
/// An instance of <see cref="Color" /> representing the value of the <paramref name="color" /> argument.
/// </returns>
public static implicit operator Color(WpfColor color)
{
return FromWpfColor(color);
}
/// <summary>
>>>>>>>
<<<<<<<
=======
/// Indicates whether the current object is equal to an instance of a
/// <see cref="System.Drawing.Color" /> struct.
/// </summary>
/// <returns>
/// <c>true</c> if the current object is equal to the <paramref name="other"/> parameter; otherwise, <c>false</c>.
/// </returns>
/// <param name="other">An instance of <see cref="System.Drawing.Color" /> to compare with this object.</param>
public bool Equals(SystemColor other)
{
return R == other.R && G == other.G && B == other.B;
}
/// <summary>
/// Indicates whether the current object is equal to an instance of a
/// <see cref="System.Windows.Media.Color" /> struct.
/// </summary>
/// <param name="other">An instance of <see cref="System.Windows.Media.Color" /> to compare with this object.</param>
/// <returns><c>true</c> if the current object is equal to the <paramref name="other" /> parameter; otherwise, <c>false</c>.</returns>
public bool Equals(WpfColor other)
{
return R == other.R && G == other.G && B == other.B;
}
/// <summary>
>>>>>>> |
<<<<<<<
=======
[Test]
public void ShouldConvertFromSystemColor()
{
var source = SystemColor.FromArgb(5, 10, 15, 20);
var coloreColor = Color.FromSystemColor(source);
Assert.AreEqual(source.R, coloreColor.R);
Assert.AreEqual(source.G, coloreColor.G);
Assert.AreEqual(source.B, coloreColor.B);
}
[Test]
public void ShouldExplicitCastToSystemColor()
{
var coloreColor = new Color(1, 2, 4);
var systemColor = (SystemColor)coloreColor;
Assert.AreEqual(coloreColor.R, systemColor.R);
Assert.AreEqual(coloreColor.G, systemColor.G);
Assert.AreEqual(coloreColor.B, systemColor.B);
}
[Test]
public void ShouldExplicitCastFromSystemColor()
{
var systemColor = SystemColor.FromArgb(5, 10, 15, 20);
var coloreColor = (Color)systemColor;
Assert.AreEqual(systemColor.R, coloreColor.R);
Assert.AreEqual(systemColor.G, coloreColor.G);
Assert.AreEqual(systemColor.B, coloreColor.B);
}
[Test]
public void ShouldImplicitCastToSystemColor()
{
var coloreColor = new Color(1, 2, 4);
SystemColor systemColor = coloreColor;
Assert.AreEqual(coloreColor.R, systemColor.R);
Assert.AreEqual(coloreColor.G, systemColor.G);
Assert.AreEqual(coloreColor.B, systemColor.B);
}
[Test]
public void ShouldImplicitCastFromSystemColor()
{
var systemColor = SystemColor.FromArgb(5, 10, 15, 20);
Color coloreColor = systemColor;
Assert.AreEqual(systemColor.R, coloreColor.R);
Assert.AreEqual(systemColor.G, coloreColor.G);
Assert.AreEqual(systemColor.B, coloreColor.B);
}
[Test]
public void ShouldEqualSystemColorUsingOverload()
{
var coloreColor = new Color(1, 2, 3);
var systemColor = SystemColor.FromArgb(8, 1, 2, 3);
Assert.True(coloreColor.Equals(systemColor));
Assert.AreEqual(coloreColor, systemColor);
}
[Test]
public void ShouldConvertFromWpfColor()
{
var wpfColor = WpfColor.FromArgb(5, 10, 15, 20);
var coloreColor = Color.FromWpfColor(wpfColor);
Assert.AreEqual(wpfColor.R, coloreColor.R);
Assert.AreEqual(wpfColor.G, coloreColor.G);
Assert.AreEqual(wpfColor.B, coloreColor.B);
}
[Test]
public void ShouldExplicitCastToWpfColor()
{
var coloreColor = new Color(1, 2, 4);
var wpfColor = (WpfColor)coloreColor;
Assert.AreEqual(coloreColor.R, wpfColor.R);
Assert.AreEqual(coloreColor.G, wpfColor.G);
Assert.AreEqual(coloreColor.B, wpfColor.B);
}
[Test]
public void ShouldExplicitCastFromWpfColor()
{
var wpfColor = WpfColor.FromArgb(5, 10, 15, 20);
var coloreColor = (Color)wpfColor;
Assert.AreEqual(wpfColor.R, coloreColor.R);
Assert.AreEqual(wpfColor.G, coloreColor.G);
Assert.AreEqual(wpfColor.B, coloreColor.B);
}
[Test]
public void ShouldImplicitCastToWpfColor()
{
var coloreColor = new Color(1, 2, 4);
WpfColor wpfColor = coloreColor;
Assert.AreEqual(coloreColor.R, wpfColor.R);
Assert.AreEqual(coloreColor.G, wpfColor.G);
Assert.AreEqual(coloreColor.B, wpfColor.B);
}
[Test]
public void ShouldImplicitCastFromWpfColor()
{
var wpfColor = WpfColor.FromArgb(5, 10, 15, 20);
Color coloreColor = wpfColor;
Assert.AreEqual(wpfColor.R, coloreColor.R);
Assert.AreEqual(wpfColor.G, coloreColor.G);
Assert.AreEqual(wpfColor.B, coloreColor.B);
}
[Test]
public void ShouldEqualWpfColorUsingOverload()
{
var coloreColor = new Color(1, 2, 3);
var wpfColor = WpfColor.FromArgb(8, 1, 2, 3);
Assert.True(coloreColor.Equals(wpfColor));
Assert.AreEqual(coloreColor, wpfColor);
}
[Test]
public void ShouldNotIgnoreHigherBitsOnCompare()
{
Color a = 0x55123456;
Color b = 0x66123456;
Assert.That(a, Is.Not.EqualTo(b));
}
>>>>>>> |
<<<<<<<
[DllImport(CvInvoke.ExternLibrary, CallingConvention = CvInvoke.CvCallingConvention)]
internal extern static IntPtr cvSoftCascadeDetectorCreate(
=======
[DllImport(CvInvoke.EXTERN_LIBRARY, CallingConvention = CvInvoke.CvCallingConvention)]
internal extern static IntPtr cveSoftCascadeDetectorCreate(
>>>>>>>
[DllImport(CvInvoke.ExternLibrary, CallingConvention = CvInvoke.CvCallingConvention)]
internal extern static IntPtr cveSoftCascadeDetectorCreate( |
<<<<<<<
using System.Threading;
=======
using System.Linq;
>>>>>>>
using System.Threading;
using System.Linq; |
<<<<<<<
=======
public SubFingerprintData AddHashedFingerprint(HashedFingerprint hashedFingerprint, IModelReference trackReference)
{
var subFingerprintReference = subFingerprintReferenceProvider.Next();
var subFingerprintData = new SubFingerprintData(
hashedFingerprint.HashBins,
hashedFingerprint.SequenceNumber,
hashedFingerprint.StartsAt,
subFingerprintReference,
trackReference,
hashedFingerprint.OriginalPoint);
AddSubFingerprint(subFingerprintData);
InsertHashes(hashedFingerprint.HashBins, subFingerprintReference.Get<uint>());
return subFingerprintData;
}
>>>>>>>
<<<<<<<
SubFingerprints[(uint)subFingerprintData.SubFingerprintReference.Id] = subFingerprintData;
InsertHashes(subFingerprintData.Hashes, (uint)subFingerprintData.SubFingerprintReference.Id);
=======
SubFingerprints[subFingerprintData.SubFingerprintReference.Get<uint>()] = subFingerprintData;
}
public TrackData AddTrack(TrackInfo track, double durationInSeconds)
{
var trackReference = trackReferenceProvider.Next();
var trackData = new TrackData(track.Id, track.Artist, track.Title, durationInSeconds, trackReference, track.MetaFields, track.MediaType);
return AddTrack(trackData);
>>>>>>>
SubFingerprints[subFingerprintData.SubFingerprintReference.Get<uint>()] = subFingerprintData;
InsertHashes(subFingerprintData.Hashes, subFingerprintData.SubFingerprintReference.Get<uint>()); |
<<<<<<<
if (!_toxAv.IsInvalid && !_toxAv.IsClosed && _toxAv != null)
=======
ClearEventSubscriptions();
if (_toxAv != null && !_toxAv.IsInvalid && !_toxAv.IsClosed)
>>>>>>>
if (_toxAv != null && !_toxAv.IsInvalid && !_toxAv.IsClosed) |
<<<<<<<
_log.WriteLine("Creating write tasks");
var tasks = writers.Select(
(writer, index) => Task.Run(
=======
var writerTasks = writers.Select(
(writer, idx) => Task.Run(
>>>>>>>
_log.WriteLine("Creating write tasks");
var tasks = writers.Select(
(writer, index) => Task.Run(
<<<<<<<
_log.WriteLine($"Writing commands on writer-{index+1}");
foreach (var number in Enumerable.Range(1, records))
=======
foreach (var number in Enumerable.Range(1, Records))
>>>>>>>
_log.WriteLine($"Writing commands on writer-{index+1}");
foreach (var number in Enumerable.Range(1, Records))
<<<<<<<
await writer.DisposeAsync().ConfigureAwait(false);
_log.WriteLine($"Done writing commands on writer-{index+1}");
=======
>>>>>>>
await writer.DisposeAsync().ConfigureAwait(false);
_log.WriteLine($"Done writing commands on writer-{index+1}");
<<<<<<<
_log.WriteLine("Disposing reader");
await reader.DisposeAsync().ConfigureAwait(false);
_log.WriteLine("Disposed reader");
=======
await engine.DisposeAsync().ConfigureAwait(false);
>>>>>>>
_log.WriteLine("Disposing reader");
await engine.DisposeAsync().ConfigureAwait(false);
_log.WriteLine("Disposed reader"); |
<<<<<<<
for (var i = 0; i < 10000; i++)
=======
for (var i = 0; i < 10000; i++)
>>>>>>>
for (var i = 0; i < 10000; i++)
<<<<<<<
writer.Dispose();
while (records.Count < 5) Thread.Sleep(0);
sub.Dispose();
Assert.Equal(5, records.Count);
}
[Theory]
[MemberData(nameof(Configurations))]
public async Task EventsWrittenAppearOnCatchUpSubscription(StorageProvider provider)
{
// Arrange
var records = new List<JournalRecord>();
var subSource = provider.CreateJournalSubscriptionSource();
var sub = subSource.Subscribe(0, records.Add);
var writer = provider.CreateJournalWriter(1);
=======
>>>>>>>
writer.Dispose();
while (records.Count < 5) Thread.Sleep(0);
sub.Dispose();
Assert.Equal(5, records.Count);
}
[Theory]
[MemberData(nameof(Configurations))]
public async Task EventsWrittenAppearOnCatchUpSubscription(StorageProvider provider)
{
// Arrange
var records = new List<JournalRecord>();
var subSource = provider.CreateJournalSubscriptionSource();
var sub = subSource.Subscribe(0, records.Add);
var writer = provider.CreateJournalWriter(1);
<<<<<<<
var tasks = Enumerable.Range(10, numRecords)
.Select(n => engine.ExecuteAsync(new AddStringCommand() {StringToAdd = n.ToString()}))
.ToArray();
int expected = 1;
foreach (var task in tasks)
=======
foreach (var number in Enumerable.Range(1, NumRecords))
>>>>>>>
foreach (var number in Enumerable.Range(1, NumRecords))
<<<<<<<
public class Reverse : Command<List<string>>
{
public override void Execute(List<string> model)
{
model.Reverse();
}
}
=======
>>>>>>> |
<<<<<<<
public Configuration SetOutputFormatter(IOutputFormatter formatter)
{
if (formatter == null)
throw new ArgumentNullException("formatter");
OutputFormatter = formatter;
return this;
}
readonly List<IValueConverter> valueConverters = new List<IValueConverter>();
=======
readonly Stack<IValueConverter> valueConverters = new Stack<IValueConverter>();
>>>>>>>
public Configuration SetOutputFormatter(IOutputFormatter formatter)
{
if (formatter == null)
throw new ArgumentNullException("formatter");
OutputFormatter = formatter;
return this;
}
readonly Stack<IValueConverter> valueConverters = new Stack<IValueConverter>(); |
<<<<<<<
[TestFixture]
class StatePrinterTest
{
[Test]
public void Instantiate()
{
Assert.Throws<ArgumentNullException>(() => new Stateprinter(null));
Assert.Throws<ArgumentNullException>(() => new StatePrinter(null));
}
}
[SetCulture("da-DK")]
=======
>>>>>>>
[TestFixture]
class StatePrinterTest
{
[Test]
public void Instantiate()
{
Assert.Throws<ArgumentNullException>(() => new Stateprinter(null));
Assert.Throws<ArgumentNullException>(() => new StatePrinter(null));
}
} |
<<<<<<<
private GUISkin skin;
private Color nodeColor;
private Color lineColor;
private Texture2D nodeTexture;
private Texture2D lineTexture;
private Rect headerSection;
private Rect portSection;
private Rect bodySection;
private Rect subBodySection;
private float nodeWidth;
private float lineWeight;
private int counter = 0;
private int count = 3;
private int stop = 6;
=======
/// <summary>
/// Rects for node layout
/// </summary>
private Rect m_BodyRect;
private Rect m_PortRect;
private Rect m_BottomRect;
>>>>>>>
private GUISkin skin;
private Color nodeColor;
private Color lineColor;
private Texture2D nodeTexture;
private Texture2D lineTexture;
private Rect headerSection;
private Rect portSection;
private Rect bodySection;
private Rect subBodySection;
private float nodeWidth;
private float lineWeight;
private int counter = 0;
private int count = 3;
private int stop = 6;
/// <summary>
/// Rects for node layout
/// </summary>
private Rect m_BodyRect;
private Rect m_PortRect;
private Rect m_BottomRect;
<<<<<<<
GUI.DrawTexture(new Rect(portSection.x, headerSection.height + portSection.height - lineWeight, portSection.width, lineWeight), lineTexture);
if (m_ExtractPosition.ReceivingData)
{
Debug.Log(counter);
foreach (var port in m_ExtractPosition.Ports)
{
if (counter >= count)
{
if (port.IsInput)
{
Vector2 positionOut = IMLNodeEditor.GetPortPosition(port);
Rect circle = new Rect(positionOut, new Vector2(500, 500));
circle.width = 20;
circle.height = 20;
Color col = GUI.color;
GUI.color = Color.white;
GUI.DrawTexture(circle, NodeEditorResources.dotOuter);
GUI.DrawTexture(circle, NodeEditorResources.dot);
//IMLNodeEditor.IMLNoodleDraw(positionOut, positionIn);
GUI.color = col;
}
if (counter == stop)
{
counter = 0;
}
}
}
counter++;
}
=======
GUI.DrawTexture(new Rect(m_PortRect.x, HeaderRect.height + m_PortRect.height - WeightOfSectionLine, m_PortRect.width, WeightOfSectionLine), GetColorTextureFromHexString("#888EF7"));
>>>>>>>
GUI.DrawTexture(new Rect(portSection.x, headerSection.height + portSection.height - lineWeight, portSection.width, lineWeight), lineTexture);
if (m_ExtractPosition.ReceivingData)
{
Debug.Log(counter);
foreach (var port in m_ExtractPosition.Ports)
{
if (counter >= count)
{
if (port.IsInput)
{
Vector2 positionOut = IMLNodeEditor.GetPortPosition(port);
Rect circle = new Rect(positionOut, new Vector2(500, 500));
circle.width = 20;
circle.height = 20;
Color col = GUI.color;
GUI.color = Color.white;
GUI.DrawTexture(circle, NodeEditorResources.dotOuter);
GUI.DrawTexture(circle, NodeEditorResources.dot);
//IMLNodeEditor.IMLNoodleDraw(positionOut, positionIn);
GUI.color = col;
}
if (counter == stop)
{
counter = 0;
}
}
}
counter++;
}
GUI.DrawTexture(new Rect(m_PortRect.x, HeaderRect.height + m_PortRect.height - WeightOfSectionLine, m_PortRect.width, WeightOfSectionLine), GetColorTextureFromHexString("#888EF7")); |
<<<<<<<
public IReadOnlyList<Target> EntryPointTargets { get; }
public ConcurrentBag<Target> OrderedTargets { get; }
public ProjectNode_BeforeThis Node_BeforeThis { get; }
public override Component Parent => ParentBuild;
=======
public IReadOnlyList<Target> EntryPointTargets => _entryPointTargets;
private readonly Dictionary<int, Target> _targetsById;
private readonly Dictionary<string, Target> _targetsByName;
private readonly List<Target> _orderedTargets;
private readonly List<Target> _entryPointTargets;
>>>>>>>
public IReadOnlyList<Target> EntryPointTargets => _entryPointTargets;
public override Component Parent => ParentBuild;
private readonly Dictionary<int, Target> _targetsById;
private readonly Dictionary<string, Target> _targetsByName;
private readonly List<Target> _orderedTargets;
private readonly List<Target> _entryPointTargets; |
<<<<<<<
// Copyright (c) Sayed Ibrahim Hashimi. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.md in the project root for license information.
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
using System.Xml;
using Microsoft.VisualStudio;
using Microsoft.VisualStudio.Shell.Interop;
=======
// Copyright (c) Sayed Ibrahim Hashimi. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.md file in the project root for full license information.
>>>>>>>
// Copyright (c) Sayed Ibrahim Hashimi. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.md file in the project root for full license information. |
<<<<<<<
/// <summary>
/// Model code
/// </summary>
public const string ModelCodeKey = "ModelCode";
/// <summary>
/// Model code
/// </summary>
public static string ModelCode => GetString(ModelCodeKey);
/// <summary>
/// Expression '{0}' do not contains any security identifiers. Format should be AAPL@NASDAQ.
/// </summary>
public const string NoSecIdsFoundKey = "NoSecIdsFound";
/// <summary>
/// Expression '{0}' do not contains any security identifiers. Format should be AAPL@NASDAQ.
/// </summary>
public static string NoSecIdsFound => GetString(NoSecIdsFoundKey);
=======
/// <summary>
/// All right reserved.
/// </summary>
public const string AllRightReservedKey = "AllRightReserved";
/// <summary>
/// All right reserved.
/// </summary>
public static string AllRightReserved => GetString(AllRightReservedKey);
>>>>>>>
/// <summary>
/// All right reserved.
/// </summary>
public const string AllRightReservedKey = "AllRightReserved";
/// <summary>
/// All right reserved.
/// </summary>
public static string AllRightReserved => GetString(AllRightReservedKey);
/// <summary>
/// Model code
/// </summary>
public const string ModelCodeKey = "ModelCode";
/// <summary>
/// Model code
/// </summary>
public static string ModelCode => GetString(ModelCodeKey);
/// <summary>
/// Expression '{0}' do not contains any security identifiers. Format should be AAPL@NASDAQ.
/// </summary>
public const string NoSecIdsFoundKey = "NoSecIdsFound";
/// <summary>
/// Expression '{0}' do not contains any security identifiers. Format should be AAPL@NASDAQ.
/// </summary>
public static string NoSecIdsFound => GetString(NoSecIdsFoundKey); |
<<<<<<<
/// <summary>
/// Volume at open
/// </summary>
public const string OpenVolumeKey = nameof(OpenVolume);
/// <summary>
/// Volume at open
/// </summary>
public static string OpenVolume => GetString(OpenVolumeKey);
/// <summary>
/// Volume at close
/// </summary>
public const string CloseVolumeKey = nameof(CloseVolume);
/// <summary>
/// Volume at close
/// </summary>
public static string CloseVolume => GetString(CloseVolumeKey);
/// <summary>
/// Volume at high
/// </summary>
public const string HighVolumeKey = nameof(HighVolume);
/// <summary>
/// Volume at high
/// </summary>
public static string HighVolume => GetString(HighVolumeKey);
/// <summary>
/// Volume at low
/// </summary>
public const string LowVolumeKey = nameof(LowVolume);
/// <summary>
/// Volume at low
/// </summary>
public static string LowVolume => GetString(LowVolumeKey);
/// <summary>
/// Relative volume
/// </summary>
public const string RelativeVolumeKey = nameof(RelativeVolume);
/// <summary>
/// Relative volume
/// </summary>
public static string RelativeVolume => GetString(RelativeVolumeKey);
/// <summary>
/// Price levels
/// </summary>
public const string PriceLevelsKey = nameof(PriceLevels);
/// <summary>
/// Price levels
/// </summary>
public static string PriceLevels => GetString(PriceLevelsKey);
=======
/// <summary>
/// MICEX TEAP
/// </summary>
public const string MicexTeapKey = nameof(MicexTeap);
/// <summary>
/// MICEX TEAP
/// </summary>
public static string MicexTeap => GetString(MicexTeapKey);
/// <summary>
/// Xignite
/// </summary>
public const string XigniteKey = nameof(Xignite);
/// <summary>
/// Xignite
/// </summary>
public static string Xignite => GetString(XigniteKey);
/// <summary>
/// Sterling
/// </summary>
public const string SterlingKey = nameof(Sterling);
/// <summary>
/// Sterling
/// </summary>
public static string Sterling => GetString(SterlingKey);
/// <summary>
/// FinViz
/// </summary>
public const string FinVizKey = nameof(FinViz);
/// <summary>
/// FinViz
/// </summary>
public static string FinViz => GetString(FinVizKey);
/// <summary>
/// Synchronize
/// </summary>
public const string SynchronizeKey = nameof(Synchronize);
/// <summary>
/// Synchronize
/// </summary>
public static string Synchronize => GetString(SynchronizeKey);
>>>>>>>
/// <summary>
/// MICEX TEAP
/// </summary>
public const string MicexTeapKey = nameof(MicexTeap);
/// <summary>
/// MICEX TEAP
/// </summary>
public static string MicexTeap => GetString(MicexTeapKey);
/// <summary>
/// Xignite
/// </summary>
public const string XigniteKey = nameof(Xignite);
/// <summary>
/// Xignite
/// </summary>
public static string Xignite => GetString(XigniteKey);
/// <summary>
/// Sterling
/// </summary>
public const string SterlingKey = nameof(Sterling);
/// <summary>
/// Sterling
/// </summary>
public static string Sterling => GetString(SterlingKey);
/// <summary>
/// FinViz
/// </summary>
public const string FinVizKey = nameof(FinViz);
/// <summary>
/// FinViz
/// </summary>
public static string FinViz => GetString(FinVizKey);
/// <summary>
/// Synchronize
/// </summary>
public const string SynchronizeKey = nameof(Synchronize);
/// <summary>
/// Synchronize
/// </summary>
public static string Synchronize => GetString(SynchronizeKey);
/// <summary>
/// Volume at open
/// </summary>
public const string OpenVolumeKey = nameof(OpenVolume);
/// <summary>
/// Volume at open
/// </summary>
public static string OpenVolume => GetString(OpenVolumeKey);
/// <summary>
/// Volume at close
/// </summary>
public const string CloseVolumeKey = nameof(CloseVolume);
/// <summary>
/// Volume at close
/// </summary>
public static string CloseVolume => GetString(CloseVolumeKey);
/// <summary>
/// Volume at high
/// </summary>
public const string HighVolumeKey = nameof(HighVolume);
/// <summary>
/// Volume at high
/// </summary>
public static string HighVolume => GetString(HighVolumeKey);
/// <summary>
/// Volume at low
/// </summary>
public const string LowVolumeKey = nameof(LowVolume);
/// <summary>
/// Volume at low
/// </summary>
public static string LowVolume => GetString(LowVolumeKey);
/// <summary>
/// Relative volume
/// </summary>
public const string RelativeVolumeKey = nameof(RelativeVolume);
/// <summary>
/// Relative volume
/// </summary>
public static string RelativeVolume => GetString(RelativeVolumeKey);
/// <summary>
/// Price levels
/// </summary>
public const string PriceLevelsKey = nameof(PriceLevels);
/// <summary>
/// Price levels
/// </summary>
public static string PriceLevels => GetString(PriceLevelsKey); |
<<<<<<<
#endregion
protected override IEnumerable<RarReaderEntry> GetEntries(Stream stream)
=======
internal override IEnumerable<RarReaderEntry> GetEntries(Stream stream)
>>>>>>>
protected override IEnumerable<RarReaderEntry> GetEntries(Stream stream) |
<<<<<<<
private readonly Stream stream;
private readonly CountingWritableSubStream rawStream;
private bool disposed;
private bool finished;
=======
private readonly Stream _stream;
private readonly CountingWritableSubStream _countingWritableSubStream;
private bool _disposed;
private readonly bool _leaveOpen;
private bool _finished;
>>>>>>>
private readonly Stream _stream;
private readonly CountingWritableSubStream _countingWritableSubStream;
private bool _disposed;
private bool _finished;
<<<<<<<
=======
_leaveOpen = leaveOpen;
>>>>>>>
<<<<<<<
rawStream?.Dispose();
=======
if (!_leaveOpen)
{
_stream.Dispose();
}
>>>>>>>
_stream.Dispose(); |
<<<<<<<
public virtual string UniqueId
{
get { return TrackInformation.FullName; }
}
private string _FileHash;
=======
private string _fileHash;
>>>>>>>
public virtual string UniqueId
{
get { return TrackInformation.FullName; }
}
private string _fileHash;
<<<<<<<
if (UniqueId == otherAsLocalTrack.UniqueId) return true;
// Mike: commented out temporarily; this is drastic measure, why is it needed?
//if (TrackInformation.Length == otherAsLocalTrack.TrackInformation.Length)
//{
// if (string.IsNullOrEmpty(_FileHash))
// _FileHash = GeneralHelper.FileToMD5Hash(TrackInformation.FullName);
// if (string.IsNullOrEmpty(otherAsLocalTrack._FileHash))
// otherAsLocalTrack._FileHash = GeneralHelper.FileToMD5Hash(TrackInformation.FullName);
// if (otherAsLocalTrack._FileHash == _FileHash) return true;
//}
=======
if (TrackInformation.FullName == otherAsLocalTrack.TrackInformation.FullName) return true;
if (TrackInformation.Length == otherAsLocalTrack.TrackInformation.Length)
{
if (string.IsNullOrEmpty(_fileHash))
_fileHash = GeneralHelper.FileToMD5Hash(TrackInformation.FullName);
if (string.IsNullOrEmpty(otherAsLocalTrack._fileHash))
otherAsLocalTrack._fileHash = GeneralHelper.FileToMD5Hash(TrackInformation.FullName);
if (otherAsLocalTrack._fileHash == _fileHash) return true;
}
>>>>>>>
if (UniqueId == otherAsLocalTrack.UniqueId) return true;
// Mike: commented out temporarily; this is drastic measure, why is it needed?
//if (TrackInformation.Length == otherAsLocalTrack.TrackInformation.Length)
//{
// if (string.IsNullOrEmpty(_fileHash))
// _fileHash = GeneralHelper.FileToMD5Hash(TrackInformation.FullName);
// if (string.IsNullOrEmpty(otherAsLocalTrack._fileHash))
// otherAsLocalTrack._fileHash = GeneralHelper.FileToMD5Hash(TrackInformation.FullName);
// if (otherAsLocalTrack._fileHash == _fileHash) return true;
//} |
<<<<<<<
/// Looks up a localized string similar to 邮箱.
=======
/// 查找类似 效果 的本地化字符串。
/// </summary>
public static string Effects {
get {
return ResourceManager.GetString("Effects", resourceCulture);
}
}
/// <summary>
/// 查找类似 邮箱 的本地化字符串。
>>>>>>>
/// Looks up a localized string similar to 邮箱.
/// 查找类似 效果 的本地化字符串。
/// </summary>
public static string Effects {
get {
return ResourceManager.GetString("Effects", resourceCulture);
}
}
/// <summary>
/// 查找类似 邮箱 的本地化字符串。
<<<<<<<
/// Looks up a localized string similar to 窗口.
=======
/// 查找类似 网站 的本地化字符串。
/// </summary>
public static string Website {
get {
return ResourceManager.GetString("Website", resourceCulture);
}
}
/// <summary>
/// 查找类似 窗口 的本地化字符串。
>>>>>>>
/// Looks up a localized string similar to 窗口.
/// 查找类似 网站 的本地化字符串。
/// </summary>
public static string Website {
get {
return ResourceManager.GetString("Website", resourceCulture);
}
}
/// <summary>
/// 查找类似 窗口 的本地化字符串。 |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.