Exemplo n.º 1
0
        public override void UpdateDatabaseRecord(DatabaseRecord record, long etag)
        {
            if (Static != null)
            {
                foreach (var definition in Static)
                {
                    record.AddIndex(definition, Source, CreatedAt, etag, RevisionsToKeep, DefaultStaticDeploymentMode ?? IndexDeploymentMode.Parallel);
                }
            }

            if (Auto != null)
            {
                foreach (var definition in Auto)
                {
                    record.AddIndex(definition, CreatedAt, etag, DefaultAutoDeploymentMode ?? IndexDeploymentMode.Parallel);
                }
            }
        }
Exemplo n.º 2
0
        public override void UpdateDatabaseRecord(DatabaseRecord record, long etag)
        {
            if (Static != null)
            {
                foreach (var definition in Static)
                {
                    record.AddIndex(definition, Source, CreatedAt, etag);
                }
            }

            if (Auto != null)
            {
                foreach (var definition in Auto)
                {
                    record.AddIndex(definition);
                }
            }
        }
Exemplo n.º 3
0
 public override void UpdateDatabaseRecord(DatabaseRecord record, long etag)
 {
     try
     {
         record.AddIndex(Definition, CreatedAt, etag, DefaultStaticDeploymentMode ?? IndexDeploymentMode.Parallel);
     }
     catch (Exception e)
     {
         throw new RachisApplyException("Failed to update auto-index", e);
     }
 }
Exemplo n.º 4
0
 public override void UpdateDatabaseRecord(DatabaseRecord record, long etag)
 {
     try
     {
         record.AddIndex(Definition);
     }
     catch (Exception e)
     {
         throw new RachisApplyException("Failed to update auto-index", e);
     }
 }
Exemplo n.º 5
0
        public override string UpdateDatabaseRecord(DatabaseRecord record, long etag)
        {
            try
            {
                record.AddIndex(Definition);
            }
            catch (Exception e)
            {
                throw new RachisApplyException("Failed to update index", e);
            }

            return(null);
        }
Exemplo n.º 6
0
        public override void UpdateDatabaseRecord(DatabaseRecord record, long etag)
        {
            try
            {
                var indexNames = record.Indexes.Select(x => x.Value.Name).ToHashSet(OrdinalIgnoreCaseStringStructComparer.Instance);

                if (indexNames.Add(Definition.Name) == false && record.Indexes.TryGetValue(Definition.Name, out var definition) == false)
                {
                    throw new InvalidOperationException($"Can not add index: {Definition.Name} because an index with the same name but different casing already exist");
                }
                record.AddIndex(Definition, Source, CreatedAt, etag);
            }
            catch (Exception e)
            {
                throw new RachisApplyException("Failed to update index", e);
            }
        }
Exemplo n.º 7
0
 public override string UpdateDatabaseRecord(DatabaseRecord record, long etag)
 {
     record.AddIndex(Definition);
     return(null);
 }