freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

數(shù)據(jù)庫設(shè)計外文翻譯--java開發(fā)20:使用hibernateshards進行切分-其他專業(yè)-資料下載頁

2025-01-19 11:58本頁面

【導讀】1.外文譯文不少于2021漢字;2.外文譯文本文格式參照論文正文規(guī)范;2)書名或論文題目;1.外文原文不少于10000印刷字符;時請用紙質(zhì)原文復(fù)印件附于譯文后。店來說,切分意味著可以保持一個受信任的RDBMS,同時不犧牲數(shù)據(jù)可伸縮性和系統(tǒng)性能。當關(guān)系數(shù)據(jù)庫試圖在一個單一表中存儲數(shù)TB的數(shù)據(jù)時,總體性能通常會降低。HibernateShards可以為您管理低。級別的切分任務(wù)。后在Hibernate實現(xiàn)它的碎片。請注意,切分首當其沖的工作是和Hibernate沒有必然關(guān)系。的,事實上,對Hibernatestards編碼部分是容易的。Java的發(fā)展前景已經(jīng)發(fā)生了根本變化,因為Java技術(shù)初現(xiàn)端倪。盡可能多的典范。為它們的目標是單獨分區(qū)中的較小型數(shù)據(jù)集。這是可能的,以協(xié)調(diào)跨分布式數(shù)據(jù)庫序列,但這樣做增加了系統(tǒng)的復(fù)雜性。的還禁止跨域查詢。像過早的優(yōu)化,分片的基礎(chǔ)上增長數(shù)據(jù)的預(yù)期可能是一個災(zāi)。分片實施的成功是基于一段時間內(nèi)適當?shù)亓私鈹?shù)據(jù)增長的應(yīng)用程序,并推斷未來。在一個電子商務(wù)系統(tǒng)的情況下,主節(jié)點可以是一個命令或一個客戶。

  

【正文】 l implementations out of the box: one executes a query in a sequential mechanism (one at a time) against shards until an answer is returned, or until all of the shards have been queried. The other implementation is a parallelaccess strategy, which uses a threading model to hit all of the shards at once. I39。m going to keep things simple and utilize the sequential strategy, aptly named SequentialShardAccessStrategy. We39。ll configure it shortly. ShardSelectionStrategy When a new object is created (that is, when a new Race or Runner is created via Hibernate), Hibernate Shards needs to know what shard the corresponding data should be written to. Accordingly, you must implement this interface and code the sharding logic. If you want a default implementation, there39。s one dubbed RoundRobinShardSelectionStrategy, which uses a roundrobin strategy for putting data into shards. For the racing application, I need to provide behavior that shards by race distance. Accordingly, I39。ll need to implement the ShardSelectionStrategy interface and provide some simple logic that shards based on a Race object39。s distance in the selectShardIdForNewObject method. (I39。ll show the Race object shortly.) At runtime, when a call is made to some savelike method on my domain objects, this interface39。s behavior is leveraged deep down in Hibernate39。s core. Listing 1. A simple shardselection strategy import 。 import 。 public class RacerShardSelectionStrategy implements ShardSelectionStrategy { public ShardId selectShardIdForNewObject(Object obj) { if (obj instanceof Race) { Race rce = (Race) obj。 return (())。 } else if (obj instanceof Runner) { Runner runnr = (Runner) obj。 if (().isEmpty()) { throw new IllegalArgumentException(runners must have at least one race)。 } else { double dist = 。 for (Race rce : ()) { dist = ()。 break。 } return (dist)。 } } else { throw new IllegalArgumentException(a nonshardable object is being created)。 } } private ShardId determineShardId(double distance){ if (distance ) { return new ShardId(1)。 } else { return new ShardId(0)。 } } } As you can see in LListing 1, if the object being persisted is a Race, then its distance is determined and, accordingly, a shard is picked. In this case, there are two shards: 0 and 1, where Shard 1 holds races with a distance greater than 10 miles and Shard 0 holds all others. If a Runner or some other object is being persisted, things get a bit more involved. I39。ve coded a logical rule that has three stipulations: ? A Runner can39。t exist without a corresponding Race. ? If a Runner has been created with multiple Races, the Runner will be persisted in the shard for the first Race found. (This rule has negative implications for the future, by the way.) ? If some other domain object is being saved, for now, an exception will be thrown. With that, you can wipe the sweat from your brow, because most of the hard work is done. The logic I39。ve captured might not be flexible enough as the racing application grows, but it39。ll work for the purpose of this demonstration! ShardResolutionStrategy When searching for an object by its key, Hibernate Shards needs a way of determining which shard to hit first. You39。ll use the SharedResolutionStrategy interface to guide it. As I mentioned earlier, sharding forces you to be keenly aware of primary keys, as you39。ll manage them yourself. Luckily, Hibernate is already good at providing key or UUID generation. Consequently, out of the box, Hibernate Shards provides an ID generator dubbed ShardedUUIDGenerator, which has the smarts to embed shard ID information in the UUID itself. If you end up using ShardedUUIDGenerator for key generation (as I will for this article), then you can can also use the Hibernate Shards outofthebox ShardResolutionStrategy implementation dubbed AllShardsShardResolutionStrategy, which can determine what shard to search based on a particular object39。s ID. Having configured the three interfaces required for Hibernate Shards to work properly, we39。re ready for the next step in sharding the example application. It39。s time to launch Hibernate39。s SessionFactory.
點擊復(fù)制文檔內(nèi)容
環(huán)評公示相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1