Get diangostic storage

@return PaginatedStorage
@throws StorageException
322018
protected function getStorage()
    {
        if (! $this->storage) {
            $storage = $this->getServiceLocator()->get(Storage::SERVICE_ID);
            if (! $storage instanceof PaginatedStorage) {
                throw new StorageException(__('The storage service provided to store the diagnostic results must be upgraded to support reads!'));
            }
            $this->storage = $storage;
        }
        return $this->storage;
    }
352557
protected function getStorage($name)
    {
        if (!array_key_exists($name, $this->storages))
        {
            throw new StorageDoesNotExistException('Invalid storage name: '.$name);
        }
        
        return $this->storages[$name];
    }
721360
public function getStorage(
        string $storage,
        array $options = [],
        string $name = 'windwalker'
    ): CacheItemPoolInterface {
        $class = class_exists($storage)
            ? $storage
            : sprintf('Windwalker\Cache\Storage\%sStorage', StringNormalise::toCamelCase($storage));

        if (!class_exists($class)) {
            throw new \DomainException(sprintf('Cache Storage: %s not supported.', ucfirst($storage)));
        }

        $config = Ioc::getConfig();

        $options['cache_time']  = $options['cache_time'] ?? $config->get('cache.time');
        $options['cache_dir']   = $options['cache_dir'] ?? $config->get('path.cache');
        $options['deny_access'] = $options['deny_access'] ?? $config->get('cache.denyAccess');

        // Convert seconds to minutes
        $options['cache_time'] *= 60;

        switch (strtolower($storage)) {
            case 'file':
            case 'php_file':
            case 'forever_file':
                return $this->createFileStorage($name, $class, $options);
                break;

            case 'redis':
            case 'memcached':
                return $this->container->newInstance(
                    $class,
                    [null, $options['cache_time'], $options]
                );
                break;

            default:
                if ($storage === FileStorage::class || is_subclass_of($storage, FileStorage::class)) {
                    return $this->createFileStorage($name, $class, $options);
                }

                return $this->container->newInstance(
                    $class,
                    [$options['cache_time'], $options]
                );
                break;
        }
    }
563124
def get_data_store(args):
    """"""
    return tacl.DataStore(args.db, args.memory, args.ram)
832127
protected function load($key) {
        try {
            return $this->memcached->get($key);
        } catch (\Exception $e) {
            throw new StorageException("Failed to load memcached key: $key", 1, $e);
        }
    }
374834
public function getPCStorage()
    {
        if (isset($this->pclasses)) {
            return $this->pclasses;
        }

        include_once 'pclasses/storage.intf.php';
        $className = $this->pcStorage.'storage';
        $pclassStorage = dirname(__FILE__) . "/pclasses/{$className}.class.php";

        include_once $pclassStorage;
        $storage = new $className;

        if (!($storage instanceof PCStorage)) {
            throw new Klarna_PCStorageInvalidException(
                $className, $pclassStorage
            );
        }
        return $storage;
    }
758389
public function buildStorageEngine()
    {
        $repositoryConfig = $this->repositoryConfigurationProvider->getRepositoryConfig();

        if (
            !(
                isset($repositoryConfig['storage']['engine'])
                && isset($this->storageEngines[$repositoryConfig['storage']['engine']])
            )
        ) {
            throw new InvalidStorageEngine(
                "Invalid storage engine '{$repositoryConfig['storage']['engine']}'. " .
                'Could not find any service tagged as ezpublish.storageEngine ' .
                "with alias {$repositoryConfig['storage']['engine']}."
            );
        }

        return $this->storageEngines[$repositoryConfig['storage']['engine']];
    }
1189184
private function getMetaDataStorage()
    {
        $metaStorage = $this->options->metaStorage;
        if ( $metaStorage === null )
        {
            $metaStorage = reset( $this->storageStack )->storage;
            if ( !( $metaStorage instanceof ezcCacheStackMetaDataStorage ) )
            {
                throw new ezcBaseValueException(
                    'metaStorage',
                    $metaStorage,
                    'ezcCacheStackMetaDataStorage',
                    'top of storage stack'
                );
            }
        }
        return $metaStorage;
    }
3867
public function getStorage()
	{
	    if(!$this->storage && $this->getServiceLocator()->has(self::STORAGE_LOCATOR_KEY)){
	        $this->setStorage($this->getServiceLocator()->get(self::STORAGE_LOCATOR_KEY));
	    }
	    
	    return $this->storage;
	}
1092285
public java.util.List<Range> getStorageSize() {
        if (storageSize == null) {
            storageSize = new com.amazonaws.internal.SdkInternalList<Range>();
        }
        return storageSize;
    }
1209739
public function getRecord($recordId, $dataDimensions = null)
    {

        if ($dataDimensions == null) {
            $dataDimensions = $this->getCurrentDataDimensions();
        }

        if ($this->isSingleContentRecordCaching()) {
            $cacheKey = $this->createCacheKey('record', [$this->getCurrentContentTypeName(), $recordId],
                                              $dataDimensions);

            $data = $this->getCacheProvider()->fetch($cacheKey);

            if ($data) {

                $data = json_decode($data, true);
                $recordFactory = $this->getRecordFactory();
                $record        = $recordFactory->createRecordFromJSON($this->getCurrentContentTypeDefinition(), $data);

                $record->setLanguage($dataDimensions->getLanguage());
                $record->setWorkspace($dataDimensions->getWorkspace());
                $record->setViewName($dataDimensions->getViewName());

                $record->setRepository($this);

                return $record;
            }

            $record = parent::getRecord($recordId, $dataDimensions);

            if ($record) {
                $data = json_encode($record);

                $this->getCacheProvider()->save($cacheKey, $data, $this->singleContentRecordCaching);
            }

            return $record;
        }

        return parent::getRecord($recordId, $dataDimensions);
    }
1062349
public static function getStorage($name=StorageInterface::class){
        if($name=='default')$name=StorageInterface::class;
        if(static::$storageArr[$name]){
            return static::$storageArr[$name];
        }
        $storage=Ioc::get($name);
        if(!$storage){
            throw new SystemException($name."文件存储不存在,你写个类可以继承自".StorageInterface::class);
        }else
        if($storage instanceof StorageInterface){
            static::$storageArr[$name]=new Storage($storage);
            return static::$storageArr[$name];
        }else{
            throw new SystemException($name."文件存储需要继承".StorageInterface::class);
        }
    }
723586
public function PaginatedGalleries()
    {
        $children = $this->AllChildren();
        $limit = $this->ThumbnailsPerPage;
        $list = ArrayList::create();

        foreach ($children as $child) {
            $image = $child->SortedImages()->first();
            $child_data = $child->toMap();
            $child_data["Link"] = $child->Link();
            if ($image) {
                $child_data["GalleryThumbnail"] = $this->ScaledImage($image, true);
            } else {
                $child_data["GalleryThumbnail"] = null;
            }
            $list->add(ArrayData::create($child_data));
        }

        $pages = PaginatedList::create($list, $this->getRequest());
        $pages->setPageLength($limit);

        return $pages;
    }
1316299
public function getStorage()
    {
        if (!isset($this->storage)) {
            // 检测配置
            $storageType = StringHelper::toClassName($this->options['storage']);
            $storageClass = '\\Wslim\\Common\\Storage\\'. $storageType . 'Storage';
            if (!class_exists($storageClass)) {
                throw new InvalidArgumentException('storage = null|file|memcache|memcached|redis|xcache ,');
            }
            
            // 实例化 storage
            $partialOptions = [];
            foreach($this->options as $k => $v) {
                if (in_array($k, StorageInterface::AllowOptions)) {
                    $partialOptions[$k] = $v;
                    //unset($this->options[$k]);
                }
            }
            
            $this->storage = new $storageClass($partialOptions);
        }
        
        return $this->storage;
    }
611940
public function getReadRequest($ids)
    {
        $cacheDataAdapter = $this->cacheDataAdapter; 
        $primaryKey = $this->primaryKey;
        return new StorageDataRequest(
            [$this->sourceDataAdapter, $this->cacheDataAdapter, $ids],
            function (DataAdapterInterface $sourceData, DataAdapterInterface $cacheData, $ids) {
                $request = $cacheData->getReadRequest($ids);
                $request->send();
                
                $cacheReadResult = $request->fetch();
                
                $cacheReadSuccess = count($cacheReadResult) == count($ids);
                if (!$cacheReadSuccess) {
                    $request = $sourceData->getReadRequest($ids);
                    $request->send();
                }
            
                return [$request, $cacheReadSuccess];
            },
            function (StorageDataRequest $request, $cacheReadSuccess) use ($cacheDataAdapter, $primaryKey) {
                $result = $request->fetch();
                if ($result && !$cacheReadSuccess) {
                    $cacheDataAdapter->getBatchInsertRequest($result)->send();
                }
                
                return $result;
            }
        );
    }
297869
private function getJsonStorage()
    {
        if (!$this->jsonStorage) {
            $this->jsonStorage = new JsonStorage(
                $this->getStorage(),
                new JsonConverterProvider($this),
                $this->getJsonEncoder(),
                $this->getJsonDecoder(),
                $this->getFactoryManager()
            );
        }

        return $this->jsonStorage;
    }
449466
function _storage()
    {
        if (! $this->_session ) {
            // Store in session by realm defined with this authentication domain
            $session = new SessionStore(self::STORAGE_IDENTITY_KEY.'_'.$this->getRealm());
            $this->_session = $session;
        }

        return $this->_session;
    }