<commit_before>package com.twitter.gizzard.nameserver

import shards._


trait ReadWriteShardAdapter extends Shard with ReadWriteShard[Shard] {
  def findShard(shardInfo: ShardInfo)                                           = readOperation(_.findShard(shardInfo))
  def getBusyShards()                                                           = readOperation(_.getBusyShards())
  def getChildShardsOfClass(parentShardId: Int, className: String)              = readOperation(_.getChildShardsOfClass(parentShardId, className))
  def getForwarding(tableId: Int, baseId: Long)                                 = readOperation(_.getForwarding(tableId, baseId))
  def getForwardingForShard(shardId: Int)                                       = readOperation(_.getForwardingForShard(shardId))
  def getForwardings()                                                          = readOperation(_.getForwardings())
  def getParentShard(shardId: Int)                                              = readOperation(_.getParentShard(shardId))
  def getRootShard(shardId: Int)                                                = readOperation(_.getRootShard(shardId))
  def getShard(shardId: Int)                                                    = readOperation(_.getShard(shardId))
  def listShardChildren(parentId: Int)                                          = readOperation(_.listShardChildren(parentId))
  def listShardChildren()                                                       = readOperation(_.listShardChildren())
  def listShards()                                                              = readOperation(_.listShards())
  def shardIdsForHostname(hostname: String, className: String): List[Int]       = readOperation(_.shardIdsForHostname(hostname, className))
  def shardsForHostname(hostname: String, className: String): List[ShardInfo]   = readOperation(_.shardsForHostname(hostname, className))

  def addChildShard(parentShardId: Int, childShardId: Int, weight: Int)         = writeOperation(_.addChildShard(parentShardId, childShardId, weight))
  def createShard(shardInfo: ShardInfo, materialize: => Unit)                   = writeOperation(_.createShard(shardInfo, materialize))
  def deleteShard(shardId: Int)                                                 = writeOperation(_.deleteShard(shardId))
  def markShardBusy(shardId: Int, busy: Busy.Value)                             = writeOperation(_.markShardBusy(shardId, busy))
  def removeChildShard(parentShardId: Int, childShardId: Int)                   = writeOperation(_.removeChildShard(parentShardId, childShardId))
  def replaceChildShard(oldChildShardId: Int, newChildShardId: Int)             = writeOperation(_.replaceChildShard(oldChildShardId, newChildShardId))
  def replaceForwarding(oldShardId: Int, newShardId: Int)                       = writeOperation(_.replaceForwarding(oldShardId, newShardId))
  def setForwarding(forwarding: Forwarding)                                     = writeOperation(_.setForwarding(forwarding))
  def updateShard(shardInfo: ShardInfo)                                         = writeOperation(_.updateShard(shardInfo))
  def nextId()                                                                  = writeOperation(_.nextId())

  def reload() = writeOperation(_.reload())
  def rebuildSchema() = writeOperation(_.rebuildSchema())
}<commit_msg>made NameServer ReadWriteShardAdapter follow convention<commit_after>package com.twitter.gizzard.nameserver

import shards._


class ReadWriteShardAdapter(shard: ReadWriteShard[Shard]) extends shards.ReadWriteShardAdapter(shard) with Shard {
  def findShard(shardInfo: ShardInfo)                                           = shard.readOperation(_.findShard(shardInfo))
  def getBusyShards()                                                           = shard.readOperation(_.getBusyShards())
  def getChildShardsOfClass(parentShardId: Int, className: String)              = shard.readOperation(_.getChildShardsOfClass(parentShardId, className))
  def getForwarding(tableId: Int, baseId: Long)                                 = shard.readOperation(_.getForwarding(tableId, baseId))
  def getForwardingForShard(shardId: Int)                                       = shard.readOperation(_.getForwardingForShard(shardId))
  def getForwardings()                                                          = shard.readOperation(_.getForwardings())
  def getParentShard(shardId: Int)                                              = shard.readOperation(_.getParentShard(shardId))
  def getRootShard(shardId: Int)                                                = shard.readOperation(_.getRootShard(shardId))
  def getShard(shardId: Int)                                                    = shard.readOperation(_.getShard(shardId))
  def listShardChildren(parentId: Int)                                          = shard.readOperation(_.listShardChildren(parentId))
  def listShardChildren()                                                       = shard.readOperation(_.listShardChildren())
  def listShards()                                                              = shard.readOperation(_.listShards())
  def shardIdsForHostname(hostname: String, className: String): List[Int]       = shard.readOperation(_.shardIdsForHostname(hostname, className))
  def shardsForHostname(hostname: String, className: String): List[ShardInfo]   = shard.readOperation(_.shardsForHostname(hostname, className))

  def addChildShard(parentShardId: Int, childShardId: Int, weight: Int)         = shard.writeOperation(_.addChildShard(parentShardId, childShardId, weight))
  def createShard(shardInfo: ShardInfo, materialize: => Unit)                   = shard.writeOperation(_.createShard(shardInfo, materialize))
  def deleteShard(shardId: Int)                                                 = shard.writeOperation(_.deleteShard(shardId))
  def markShardBusy(shardId: Int, busy: Busy.Value)                             = shard.writeOperation(_.markShardBusy(shardId, busy))
  def removeChildShard(parentShardId: Int, childShardId: Int)                   = shard.writeOperation(_.removeChildShard(parentShardId, childShardId))
  def replaceChildShard(oldChildShardId: Int, newChildShardId: Int)             = shard.writeOperation(_.replaceChildShard(oldChildShardId, newChildShardId))
  def replaceForwarding(oldShardId: Int, newShardId: Int)                       = shard.writeOperation(_.replaceForwarding(oldShardId, newShardId))
  def setForwarding(forwarding: Forwarding)                                     = shard.writeOperation(_.setForwarding(forwarding))
  def updateShard(shardInfo: ShardInfo)                                         = shard.writeOperation(_.updateShard(shardInfo))
  def nextId()                                                                  = shard.writeOperation(_.nextId())

  def reload()                                                                  = shard.writeOperation(_.reload())
  def rebuildSchema()                                                           = shard.writeOperation(_.rebuildSchema())
}
{'fraction_non_alphanumeric': 0.08376963350785341, 'fraction_numerical': 0.0, 'mean_word_length': 2.0, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 60, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7393746', 'n_tokens_mistral': 1772, 'n_tokens_neox': 1753, 'n_words': 289}